2007-05-22 Paul Brook <paul@codesourcery.com>
ld/testsuite/ * ld-arm/arm-pic-veneer.d: Update expected output. * ld-arm/arm-call.d: Ditto. bfd/ * elf32-arm.c (output_arch_syminfo): Replace plt_shndx and plt_offset with sec and sec_shndx. (elf32_arm_ouput_plt_map_sym): Use them. (elf32_arm_output_arch_local_syms): Output mapping symbols for interworking glue.
This commit is contained in:
parent
e39ff52a3b
commit
91a5743d01
|
@ -1,3 +1,11 @@
|
||||||
|
2007-05-22 Paul Brook <paul@codesourcery.com>
|
||||||
|
|
||||||
|
* elf32-arm.c (output_arch_syminfo): Replace plt_shndx and plt_offset
|
||||||
|
with sec and sec_shndx.
|
||||||
|
(elf32_arm_ouput_plt_map_sym): Use them.
|
||||||
|
(elf32_arm_output_arch_local_syms): Output mapping symbols for
|
||||||
|
interworking glue.
|
||||||
|
|
||||||
2007-05-18 Paul Brook <paul@codesourcery.com>
|
2007-05-18 Paul Brook <paul@codesourcery.com>
|
||||||
|
|
||||||
* elf32-arm.c (ARM2THUMB_V5_STATIC_GLUE_SIZE): Define.
|
* elf32-arm.c (ARM2THUMB_V5_STATIC_GLUE_SIZE): Define.
|
||||||
|
|
|
@ -10045,8 +10045,8 @@ typedef struct
|
||||||
{
|
{
|
||||||
void *finfo;
|
void *finfo;
|
||||||
struct bfd_link_info *info;
|
struct bfd_link_info *info;
|
||||||
int plt_shndx;
|
asection *sec;
|
||||||
bfd_vma plt_offset;
|
int sec_shndx;
|
||||||
bfd_boolean (*func) (void *, const char *, Elf_Internal_Sym *,
|
bfd_boolean (*func) (void *, const char *, Elf_Internal_Sym *,
|
||||||
asection *, struct elf_link_hash_entry *);
|
asection *, struct elf_link_hash_entry *);
|
||||||
} output_arch_syminfo;
|
} output_arch_syminfo;
|
||||||
|
@ -10071,12 +10071,14 @@ elf32_arm_ouput_plt_map_sym (output_arch_syminfo *osi,
|
||||||
Elf_Internal_Sym sym;
|
Elf_Internal_Sym sym;
|
||||||
|
|
||||||
htab = elf32_arm_hash_table (osi->info);
|
htab = elf32_arm_hash_table (osi->info);
|
||||||
sym.st_value = osi->plt_offset + offset;
|
sym.st_value = osi->sec->output_section->vma
|
||||||
|
+ osi->sec->output_offset
|
||||||
|
+ offset;
|
||||||
sym.st_size = 0;
|
sym.st_size = 0;
|
||||||
sym.st_other = 0;
|
sym.st_other = 0;
|
||||||
sym.st_info = ELF_ST_INFO (STB_LOCAL, STT_NOTYPE);
|
sym.st_info = ELF_ST_INFO (STB_LOCAL, STT_NOTYPE);
|
||||||
sym.st_shndx = osi->plt_shndx;
|
sym.st_shndx = osi->sec_shndx;
|
||||||
if (!osi->func (osi->finfo, names[type], &sym, htab->splt, NULL))
|
if (!osi->func (osi->finfo, names[type], &sym, osi->sec, NULL))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -10157,7 +10159,7 @@ elf32_arm_output_plt_map (struct elf_link_hash_entry *h, void *inf)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Output mapping symbols for the PLT. */
|
/* Output mapping symbols for linker generated sections. */
|
||||||
|
|
||||||
static bfd_boolean
|
static bfd_boolean
|
||||||
elf32_arm_output_arch_local_syms (bfd *output_bfd,
|
elf32_arm_output_arch_local_syms (bfd *output_bfd,
|
||||||
|
@ -10169,19 +10171,63 @@ elf32_arm_output_arch_local_syms (bfd *output_bfd,
|
||||||
{
|
{
|
||||||
output_arch_syminfo osi;
|
output_arch_syminfo osi;
|
||||||
struct elf32_arm_link_hash_table *htab;
|
struct elf32_arm_link_hash_table *htab;
|
||||||
|
bfd_vma offset;
|
||||||
|
bfd_size_type size;
|
||||||
|
|
||||||
htab = elf32_arm_hash_table (info);
|
htab = elf32_arm_hash_table (info);
|
||||||
if (!htab->splt || htab->splt->size == 0)
|
|
||||||
return TRUE;
|
|
||||||
|
|
||||||
check_use_blx(htab);
|
check_use_blx(htab);
|
||||||
|
|
||||||
osi.finfo = finfo;
|
osi.finfo = finfo;
|
||||||
osi.info = info;
|
osi.info = info;
|
||||||
osi.func = func;
|
osi.func = func;
|
||||||
osi.plt_shndx = _bfd_elf_section_from_bfd_section (output_bfd,
|
|
||||||
htab->splt->output_section);
|
/* ARM->Thumb glue. */
|
||||||
osi.plt_offset = htab->splt->output_section->vma;
|
if (htab->arm_glue_size > 0)
|
||||||
|
{
|
||||||
|
osi.sec = bfd_get_section_by_name (htab->bfd_of_glue_owner,
|
||||||
|
ARM2THUMB_GLUE_SECTION_NAME);
|
||||||
|
|
||||||
|
osi.sec_shndx = _bfd_elf_section_from_bfd_section
|
||||||
|
(output_bfd, osi.sec->output_section);
|
||||||
|
if (info->shared || htab->root.is_relocatable_executable
|
||||||
|
|| htab->pic_veneer)
|
||||||
|
size = ARM2THUMB_PIC_GLUE_SIZE;
|
||||||
|
else if (htab->use_blx)
|
||||||
|
size = ARM2THUMB_V5_STATIC_GLUE_SIZE;
|
||||||
|
else
|
||||||
|
size = ARM2THUMB_STATIC_GLUE_SIZE;
|
||||||
|
|
||||||
|
for (offset = 0; offset < htab->arm_glue_size; offset += size)
|
||||||
|
{
|
||||||
|
elf32_arm_ouput_plt_map_sym (&osi, ARM_MAP_ARM, offset);
|
||||||
|
elf32_arm_ouput_plt_map_sym (&osi, ARM_MAP_DATA, offset + size - 4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Thumb->ARM glue. */
|
||||||
|
if (htab->thumb_glue_size > 0)
|
||||||
|
{
|
||||||
|
osi.sec = bfd_get_section_by_name (htab->bfd_of_glue_owner,
|
||||||
|
THUMB2ARM_GLUE_SECTION_NAME);
|
||||||
|
|
||||||
|
osi.sec_shndx = _bfd_elf_section_from_bfd_section
|
||||||
|
(output_bfd, osi.sec->output_section);
|
||||||
|
size = THUMB2ARM_GLUE_SIZE;
|
||||||
|
|
||||||
|
for (offset = 0; offset < htab->thumb_glue_size; offset += size)
|
||||||
|
{
|
||||||
|
elf32_arm_ouput_plt_map_sym (&osi, ARM_MAP_THUMB, offset);
|
||||||
|
elf32_arm_ouput_plt_map_sym (&osi, ARM_MAP_ARM, offset + 4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Finally, output mapping symbols for the PLT. */
|
||||||
|
if (!htab->splt || htab->splt->size == 0)
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
|
osi.sec_shndx = _bfd_elf_section_from_bfd_section (output_bfd,
|
||||||
|
htab->splt->output_section);
|
||||||
|
osi.sec = htab->splt;
|
||||||
/* Output mapping symbols for the plt header. SymbianOS does not have a
|
/* Output mapping symbols for the plt header. SymbianOS does not have a
|
||||||
plt header. */
|
plt header. */
|
||||||
if (htab->vxworks_p)
|
if (htab->vxworks_p)
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
2007-05-22 Paul Brook <paul@codesourcery.com>
|
||||||
|
|
||||||
|
* ld-arm/arm-pic-veneer.d: Update expected output.
|
||||||
|
* ld-arm/arm-call.d: Ditto.
|
||||||
|
|
||||||
2007-05-22 Paul Brook <paul@codesourcery.com>
|
2007-05-22 Paul Brook <paul@codesourcery.com>
|
||||||
|
|
||||||
* ld-arm-mixed-lib.d: Update expected output.
|
* ld-arm-mixed-lib.d: Update expected output.
|
||||||
|
|
|
@ -49,8 +49,8 @@ Disassembly of section .text:
|
||||||
|
|
||||||
0000805c <__t1_from_arm>:
|
0000805c <__t1_from_arm>:
|
||||||
805c: e51ff004 ldr pc, \[pc, #-4\] ; 8060 <__t1_from_arm\+0x4>
|
805c: e51ff004 ldr pc, \[pc, #-4\] ; 8060 <__t1_from_arm\+0x4>
|
||||||
8060: 00008041 andeq r8, r0, r1, asr #32
|
8060: 00008041 .word 0x00008041
|
||||||
|
|
||||||
00008064 <__t2_from_arm>:
|
00008064 <__t2_from_arm>:
|
||||||
8064: e51ff004 ldr pc, \[pc, #-4\] ; 8068 <__t2_from_arm\+0x4>
|
8064: e51ff004 ldr pc, \[pc, #-4\] ; 8068 <__t2_from_arm\+0x4>
|
||||||
8068: 00008043 andeq r8, r0, r3, asr #32
|
8068: 00008043 .word 0x00008043
|
||||||
|
|
|
@ -14,4 +14,4 @@ Disassembly of section .text:
|
||||||
8008: e59fc004 ldr ip, \[pc, #4\] ; 8014 <__foo_from_arm\+0xc>
|
8008: e59fc004 ldr ip, \[pc, #4\] ; 8014 <__foo_from_arm\+0xc>
|
||||||
800c: e08cc00f add ip, ip, pc
|
800c: e08cc00f add ip, ip, pc
|
||||||
8010: e12fff1c bx ip
|
8010: e12fff1c bx ip
|
||||||
8014: fffffff1 undefined instruction 0xfffffff1
|
8014: fffffff1 .word 0xfffffff1
|
||||||
|
|
Loading…
Reference in New Issue