From: Paul Brook Date: Tue, 22 May 2007 17:17:53 +0000 (+0000) Subject: 2007-05-22 Paul Brook X-Git-Tag: binutils-2_18-branchpoint~663 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=91a5743d016cd12f0128645a278f0b3980252f82;p=external%2Fbinutils.git 2007-05-22 Paul Brook 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. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 6d8c673..f58c798 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,11 @@ +2007-05-22 Paul Brook + + * 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 * elf32-arm.c (ARM2THUMB_V5_STATIC_GLUE_SIZE): Define. diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c index d36c923e..6c85e52 100644 --- a/bfd/elf32-arm.c +++ b/bfd/elf32-arm.c @@ -10045,8 +10045,8 @@ typedef struct { void *finfo; struct bfd_link_info *info; - int plt_shndx; - bfd_vma plt_offset; + asection *sec; + int sec_shndx; bfd_boolean (*func) (void *, const char *, Elf_Internal_Sym *, asection *, struct elf_link_hash_entry *); } output_arch_syminfo; @@ -10071,12 +10071,14 @@ elf32_arm_ouput_plt_map_sym (output_arch_syminfo *osi, Elf_Internal_Sym sym; 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_other = 0; sym.st_info = ELF_ST_INFO (STB_LOCAL, STT_NOTYPE); - sym.st_shndx = osi->plt_shndx; - if (!osi->func (osi->finfo, names[type], &sym, htab->splt, NULL)) + sym.st_shndx = osi->sec_shndx; + if (!osi->func (osi->finfo, names[type], &sym, osi->sec, NULL)) return FALSE; 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 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; struct elf32_arm_link_hash_table *htab; + bfd_vma offset; + bfd_size_type size; htab = elf32_arm_hash_table (info); - if (!htab->splt || htab->splt->size == 0) - return TRUE; - check_use_blx(htab); + osi.finfo = finfo; osi.info = info; osi.func = func; - osi.plt_shndx = _bfd_elf_section_from_bfd_section (output_bfd, - htab->splt->output_section); - osi.plt_offset = htab->splt->output_section->vma; + + /* ARM->Thumb glue. */ + 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 plt header. */ if (htab->vxworks_p) diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index c4662f7..0eba593 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2007-05-22 Paul Brook + * ld-arm/arm-pic-veneer.d: Update expected output. + * ld-arm/arm-call.d: Ditto. + +2007-05-22 Paul Brook + * ld-arm-mixed-lib.d: Update expected output. * ld-arm/arm-app.d: Ditto. * ld-arm/mixed-app.d: Ditto. diff --git a/ld/testsuite/ld-arm/arm-call.d b/ld/testsuite/ld-arm/arm-call.d index 3a55deb..34c31d9 100644 --- a/ld/testsuite/ld-arm/arm-call.d +++ b/ld/testsuite/ld-arm/arm-call.d @@ -49,8 +49,8 @@ Disassembly of section .text: 0000805c <__t1_from_arm>: 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>: 8064: e51ff004 ldr pc, \[pc, #-4\] ; 8068 <__t2_from_arm\+0x4> - 8068: 00008043 andeq r8, r0, r3, asr #32 + 8068: 00008043 .word 0x00008043 diff --git a/ld/testsuite/ld-arm/arm-pic-veneer.d b/ld/testsuite/ld-arm/arm-pic-veneer.d index cbd5822..97eeb52 100644 --- a/ld/testsuite/ld-arm/arm-pic-veneer.d +++ b/ld/testsuite/ld-arm/arm-pic-veneer.d @@ -14,4 +14,4 @@ Disassembly of section .text: 8008: e59fc004 ldr ip, \[pc, #4\] ; 8014 <__foo_from_arm\+0xc> 800c: e08cc00f add ip, ip, pc 8010: e12fff1c bx ip - 8014: fffffff1 undefined instruction 0xfffffff1 + 8014: fffffff1 .word 0xfffffff1