mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-27 22:48:57 +08:00
[BFD][AARCH64]Emit single AARCH64_MAP_INSN symbol for the whole plt.
bfd/ 2015-10-01 Renlin Li <renlin.li@arm.com> * elfnn-aarch64.c (elfNN_aarch64_output_plt_map): Remove. (elfNN_aarch64_output_arch_local_syms): Emit AARCH64_MAP_INSN once. ld/testsuite/ 2015-10-01 Renlin Li <renlin.li@arm.com> * ld-aarch64/plt_mapping_symbol.d: New. * ld-aarch64/plt_mapping_symbol.s: New. * ld-aarch64/aarch64-elf.exp: Run the new test.
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
2015-10-01 Renlin Li <renlin.li@arm.com>
|
||||||
|
|
||||||
|
* elfnn-aarch64.c (elfNN_aarch64_output_plt_map): Remove.
|
||||||
|
(elfNN_aarch64_output_arch_local_syms): Emit AARCH64_MAP_INSN once.
|
||||||
|
|
||||||
2015-10-01 Kaz Kojima <kkojima@rr.iij4u.or.jp>
|
2015-10-01 Kaz Kojima <kkojima@rr.iij4u.or.jp>
|
||||||
|
|
||||||
* config.bfd (targ_selvecs): Remove sh_elf32_vec and
|
* config.bfd (targ_selvecs): Remove sh_elf32_vec and
|
||||||
|
@ -7310,38 +7310,6 @@ elfNN_aarch64_output_map_sym (output_arch_syminfo *osi,
|
|||||||
return osi->func (osi->finfo, names[type], &sym, osi->sec, NULL) == 1;
|
return osi->func (osi->finfo, names[type], &sym, osi->sec, NULL) == 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Output mapping symbols for PLT entries associated with H. */
|
|
||||||
|
|
||||||
static bfd_boolean
|
|
||||||
elfNN_aarch64_output_plt_map (struct elf_link_hash_entry *h, void *inf)
|
|
||||||
{
|
|
||||||
output_arch_syminfo *osi = (output_arch_syminfo *) inf;
|
|
||||||
bfd_vma addr;
|
|
||||||
|
|
||||||
if (h->root.type == bfd_link_hash_indirect)
|
|
||||||
return TRUE;
|
|
||||||
|
|
||||||
if (h->root.type == bfd_link_hash_warning)
|
|
||||||
/* When warning symbols are created, they **replace** the "real"
|
|
||||||
entry in the hash table, thus we never get to see the real
|
|
||||||
symbol in a hash traversal. So look at it now. */
|
|
||||||
h = (struct elf_link_hash_entry *) h->root.u.i.link;
|
|
||||||
|
|
||||||
if (h->plt.offset == (bfd_vma) - 1)
|
|
||||||
return TRUE;
|
|
||||||
|
|
||||||
addr = h->plt.offset;
|
|
||||||
if (addr == 32)
|
|
||||||
{
|
|
||||||
if (!elfNN_aarch64_output_map_sym (osi, AARCH64_MAP_INSN, addr))
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Output a single local symbol for a generated stub. */
|
/* Output a single local symbol for a generated stub. */
|
||||||
|
|
||||||
static bfd_boolean
|
static bfd_boolean
|
||||||
@ -7474,13 +7442,11 @@ elfNN_aarch64_output_arch_local_syms (bfd *output_bfd,
|
|||||||
if (!htab->root.splt || htab->root.splt->size == 0)
|
if (!htab->root.splt || htab->root.splt->size == 0)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
/* For now live without mapping symbols for the plt. */
|
|
||||||
osi.sec_shndx = _bfd_elf_section_from_bfd_section
|
osi.sec_shndx = _bfd_elf_section_from_bfd_section
|
||||||
(output_bfd, htab->root.splt->output_section);
|
(output_bfd, htab->root.splt->output_section);
|
||||||
osi.sec = htab->root.splt;
|
osi.sec = htab->root.splt;
|
||||||
|
|
||||||
elf_link_hash_traverse (&htab->root, elfNN_aarch64_output_plt_map,
|
elfNN_aarch64_output_map_sym (&osi, AARCH64_MAP_INSN, 0);
|
||||||
(void *) &osi);
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
2015-10-01 Renlin Li <renlin.li@arm.com>
|
||||||
|
|
||||||
|
* ld-aarch64/aarch64-elf.exp: Run the new test.
|
||||||
|
* ld-aarch64/plt_mapping_symbol.d: New.
|
||||||
|
* ld-aarch64/plt_mapping_symbol.s: New.
|
||||||
|
|
||||||
2015-10-01 Alan Modra <amodra@gmail.com>
|
2015-10-01 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
* ld-x86-64/pr19013-x32.d: Update.
|
* ld-x86-64/pr19013-x32.d: Update.
|
||||||
|
@ -254,6 +254,8 @@ run_dump_test "relocs-1027-symbolic-func"
|
|||||||
|
|
||||||
run_dump_test "dt_textrel"
|
run_dump_test "dt_textrel"
|
||||||
|
|
||||||
|
run_dump_test "plt_mapping_symbol"
|
||||||
|
|
||||||
set aarch64elflinktests {
|
set aarch64elflinktests {
|
||||||
{"ld-aarch64/so with global symbol" "-shared" "" "" {copy-reloc-so.s}
|
{"ld-aarch64/so with global symbol" "-shared" "" "" {copy-reloc-so.s}
|
||||||
{} "copy-reloc-so.so"}
|
{} "copy-reloc-so.so"}
|
||||||
|
10
ld/testsuite/ld-aarch64/plt_mapping_symbol.d
Normal file
10
ld/testsuite/ld-aarch64/plt_mapping_symbol.d
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#source: plt_mapping_symbol.s
|
||||||
|
#ld: -shared -T relocs.ld -e0
|
||||||
|
#objdump: --syms --special-syms
|
||||||
|
#name: AArch64 mapping symbol for plt section test.
|
||||||
|
#...
|
||||||
|
|
||||||
|
SYMBOL TABLE:
|
||||||
|
#...
|
||||||
|
[0]+10010 l .plt 0[0]+00 \$x
|
||||||
|
#...
|
6
ld/testsuite/ld-aarch64/plt_mapping_symbol.s
Normal file
6
ld/testsuite/ld-aarch64/plt_mapping_symbol.s
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
.text
|
||||||
|
test:
|
||||||
|
bl __tls_get_addr
|
||||||
|
nop
|
||||||
|
|
||||||
|
.xword 0xffee
|
Reference in New Issue
Block a user