mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-27 04:52:05 +08:00
7f923b7fd2
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.
75 lines
1.9 KiB
Makefile
75 lines
1.9 KiB
Makefile
.*: file format elf32-.*arm
|
|
architecture: arm.*, flags 0x00000150:
|
|
HAS_SYMS, DYNAMIC, D_PAGED
|
|
start address 0x.*
|
|
|
|
Disassembly of section .plt:
|
|
|
|
0000813c <.plt>:
|
|
.*: e52de004 push {lr} ; .*
|
|
.*: e59fe004 ldr lr, \[pc, #4\] ; .*
|
|
.*: e08fe00e add lr, pc, lr
|
|
.*: e5bef008 ldr pc, \[lr, #8\]!
|
|
.*: 000080f0 .word 0x000080f0
|
|
.*: e08e0000 add r0, lr, r0
|
|
.*: e5901004 ldr r1, \[r0, #4\]
|
|
.*: e12fff11 bx r1
|
|
.*: e52d2004 push {r2} ; .*
|
|
.*: e59f200c ldr r2, \[pc, #12\] ; .*
|
|
.*: e59f100c ldr r1, \[pc, #12\] ; .*
|
|
.*: e79f2002 ldr r2, \[pc, r2\]
|
|
.*: e081100f add r1, r1, pc
|
|
.*: e12fff12 bx r2
|
|
.*: 000080e8 .word 0x000080e8
|
|
.*: 000080c8 .word 0x000080c8
|
|
|
|
Disassembly of section .text:
|
|
|
|
00008180 <text>:
|
|
.*: e59f0004 ldr r0, \[pc, #4\] ; .*
|
|
.*: ebfffff1 bl .* <\.plt\+0x14>
|
|
.*: e1a00000 nop ; .*
|
|
.*: 000080c0 .word 0x000080c0
|
|
.*: 4801 ldr r0, \[pc, #4\] ; .*
|
|
.*: f000 f805 bl .* <__unnamed_veneer>
|
|
.*: 46c0 nop ; .*
|
|
.*: 000080b1 .word 0x000080b1
|
|
.*: 00000000 .word 0x00000000
|
|
|
|
000081a0 <__unnamed_veneer>:
|
|
.*: 4778 bx pc
|
|
.*: 46c0 nop ; .*
|
|
.*: e59f1000 ldr r1, \[pc\] ; .*
|
|
.*: e081f00f add pc, r1, pc
|
|
.*: ffffffa0 .word 0xffffffa0
|
|
|
|
Disassembly of section .foo:
|
|
|
|
04001000 <foo>:
|
|
.*: e59f0004 ldr r0, \[pc, #4\] ; .*
|
|
.*: eb000009 bl 4001030 .*
|
|
.*: e1a00000 nop ; .*
|
|
.*: fc00f240 .word 0xfc00f240
|
|
.*: e59f0004 ldr r0, \[pc, #4\] ; .*
|
|
.*: eb000005 bl 4001030 .*
|
|
.*: e1a00000 nop ; .*
|
|
.*: fc00f238 .word 0xfc00f238
|
|
.*: 4801 ldr r0, \[pc, #4\] ; .*
|
|
.*: f000 f80b bl 400103c .*
|
|
.*: 46c0 nop ; .*
|
|
.*: fc00f221 .word 0xfc00f221
|
|
.*: 00000000 .word 0x00000000
|
|
|
|
04001030 <__unnamed_veneer>:
|
|
.*: e59f1000 ldr r1, \[pc\] ; .*
|
|
.*: e08ff001 add pc, pc, r1
|
|
.*: fc007114 .word 0xfc007114
|
|
|
|
0400103c <__unnamed_veneer>:
|
|
.*: 4778 bx pc
|
|
.*: 46c0 nop ; .*
|
|
.*: e59f1000 ldr r1, \[pc\] ; .*
|
|
.*: e081f00f add pc, r1, pc
|
|
.*: fc007104 .word 0xfc007104
|
|
.*: 00000000 .word 0x00000000
|