diff options
author | Alan Modra <amodra@gmail.com> | 2018-06-14 08:59:12 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2018-06-14 11:32:01 +0930 |
commit | 7f923b7fd2a7c55f2337b3b79a2b2081a7bbe22b (patch) | |
tree | aad8e15a309500a29959a760efe168e09026ec33 /bfd/elfxx-mips.c | |
parent | ff91d2f0e20fc91b6b101a0b20cbd38ab2d7fb50 (diff) | |
download | gdb-7f923b7fd2a7c55f2337b3b79a2b2081a7bbe22b.zip gdb-7f923b7fd2a7c55f2337b3b79a2b2081a7bbe22b.tar.gz gdb-7f923b7fd2a7c55f2337b3b79a2b2081a7bbe22b.tar.bz2 |
ELF dynsyms
Many ELF targets arrange to emit a number of section symbols in
.dynsym for use by dynamic relocations. This happens before the
dynamic relocations are output, and the need for those symbols
determined. In most cases they are not needed. A proper analysis of
the need for dynamic section symbols is target specific and tedious,
so this patch just excludes them in the obvious case when no
dynamic relocations are present.
The patch also runs the new pr23161 and pr23162 tests on more targets.
bfd/
* elf-bfd.h (struct elf_link_hash_table): Add "dynamic_relocs".
* elflink.c (_bfd_elf_init_2_index_sections): Comment fix.
(_bfd_elf_add_dynamic_entry): Set "dynamic_relocs".
(_bfd_elf_link_renumber_dynsyms): Exclude all section symbols when
"dynamic_relocs" is not set.
* elfxx-mips.c (count_section_dynsyms): Likewise.
ld/
* testsuite/ld-elf/readelf.exp: Delete DUMP and selection of
variant ver_def.vd.
* testsuite/ld-elf/ver_def-tic6x.vd: Delete.
* testsuite/ld-elf/shared.exp: Run most pr23161 and pr23162 tests for
linux, nacl and gnu targets.
* testsuite/ld-mips-elf/mips-elf.exp: Set base_syms to 1.
* testsuite/ld-elf/pr23161a.rd: Don't check reloc type. Allow any
order of __bss_start, _edata and _end.
* testsuite/ld-elf/pr23161b.rd: Don't check plt and dyn relocs.
Allow and order of __bss_start, _edata and _end.
* testsuite/ld-elf/pr23162.rd: Fail if __bss_start, _edata or _end
relocs are present rather than testing for no relocations.
* testsuite/ld-aarch64/gc-plt-relocs.d,
* testsuite/ld-aarch64/ifunc-1-local.d,
* testsuite/ld-aarch64/ifunc-1.d,
* testsuite/ld-aarch64/ifunc-2-local.d,
* testsuite/ld-aarch64/ifunc-2.d,
* testsuite/ld-aarch64/ifunc-21.d,
* testsuite/ld-aarch64/ifunc-3a.d,
* testsuite/ld-arm/farcall-mixed-lib-v4t.d,
* testsuite/ld-arm/farcall-mixed-lib.d,
* testsuite/ld-arm/gc-hidden-1.d,
* testsuite/ld-arm/tls-gdesc-got.d,
* testsuite/ld-arm/tls-lib-loc.d,
* testsuite/ld-arm/tls-longplt-lib.d,
* testsuite/ld-arm/tls-thumb1.d,
* testsuite/ld-cris/libdso-10.d,
* testsuite/ld-cris/libdso-11.d,
* testsuite/ld-cris/libdso-13b.d,
* testsuite/ld-cris/libdso-14.d,
* testsuite/ld-cris/libdso-15.d,
* testsuite/ld-cris/pic-gc-72.d,
* testsuite/ld-cris/pic-gc-73.d,
* testsuite/ld-cris/tls-gc-71.d,
* testsuite/ld-mips-elf/mips16-pic-4a.nd,
* testsuite/ld-mips-elf/pic-and-nonpic-3a.dd,
* testsuite/ld-mips-elf/pie-n32.d,
* testsuite/ld-mips-elf/pie-n64.d,
* testsuite/ld-mips-elf/pie-o32.d: Update for removed dynamic
section symbols.
Diffstat (limited to 'bfd/elfxx-mips.c')
-rw-r--r-- | bfd/elfxx-mips.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c index 205faa6..6e2f6fe 100644 --- a/bfd/elfxx-mips.c +++ b/bfd/elfxx-mips.c @@ -3813,6 +3813,7 @@ count_section_dynsyms (bfd *output_bfd, struct bfd_link_info *info) for (p = output_bfd->sections; p ; p = p->next) if ((p->flags & SEC_EXCLUDE) == 0 && (p->flags & SEC_ALLOC) != 0 + && elf_hash_table (info)->dynamic_relocs && !(*bed->elf_backend_omit_section_dynsym) (output_bfd, info, p)) ++count; } |