aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-cris
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2018-06-14 08:59:12 +0930
committerAlan Modra <amodra@gmail.com>2018-06-14 11:32:01 +0930
commit7f923b7fd2a7c55f2337b3b79a2b2081a7bbe22b (patch)
treeaad8e15a309500a29959a760efe168e09026ec33 /ld/testsuite/ld-cris
parentff91d2f0e20fc91b6b101a0b20cbd38ab2d7fb50 (diff)
downloadgdb-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 'ld/testsuite/ld-cris')
-rw-r--r--ld/testsuite/ld-cris/libdso-10.d22
-rw-r--r--ld/testsuite/ld-cris/libdso-11.d18
-rw-r--r--ld/testsuite/ld-cris/libdso-13b.d2
-rw-r--r--ld/testsuite/ld-cris/libdso-14.d6
-rw-r--r--ld/testsuite/ld-cris/libdso-15.d14
-rw-r--r--ld/testsuite/ld-cris/pic-gc-72.d8
-rw-r--r--ld/testsuite/ld-cris/pic-gc-73.d7
-rw-r--r--ld/testsuite/ld-cris/tls-gc-71.d8
8 files changed, 42 insertions, 43 deletions
diff --git a/ld/testsuite/ld-cris/libdso-10.d b/ld/testsuite/ld-cris/libdso-10.d
index ee7f7e1..0f0d562 100644
--- a/ld/testsuite/ld-cris/libdso-10.d
+++ b/ld/testsuite/ld-cris/libdso-10.d
@@ -9,29 +9,29 @@
Program Header:
LOAD off 0x0+ vaddr 0x0+ paddr 0x0+ align 2\*\*13
- filesz 0x0+e8 memsz 0x0+e8 flags r-x
- LOAD off 0x0+e8 vaddr 0x0+20e8 paddr 0x0+20e8 align 2\*\*13
+ filesz 0x0+d4 memsz 0x0+d4 flags r-x
+ LOAD off 0x0+d4 vaddr 0x0+20d4 paddr 0x0+20d4 align 2\*\*13
filesz 0x0+64 memsz 0x0+64 flags rw-
- DYNAMIC off 0x0+e8 vaddr 0x0+20e8 paddr 0x0+20e8 align 2\*\*2
+ DYNAMIC off 0x0+d4 vaddr 0x0+20d4 paddr 0x0+20d4 align 2\*\*2
filesz 0x0+58 memsz 0x0+58 flags rw-
Dynamic Section:
HASH.*0x0*94
- STRTAB.*0x0*dc
- SYMTAB.*0x0*ac
+ STRTAB.*0x0*c8
+ SYMTAB.*0x0*a8
STRSZ.*0x0*7
SYMENT.*0x0*10
private flags = 2: \[v32\]
Sections:
Idx Name Size VMA LMA File off Algn
- 0 \.hash 0+18 0+94 0+94 0+94 2\*\*2
+ 0 \.hash 0+14 0+94 0+94 0+94 2\*\*2
CONTENTS, ALLOC, LOAD, READONLY, DATA
- 1 \.dynsym 0+30 0+ac 0+ac 0+ac 2\*\*2
+ 1 \.dynsym 0+20 0+a8 0+a8 0+a8 2\*\*2
CONTENTS, ALLOC, LOAD, READONLY, DATA
- 2 \.dynstr 0+7 0+dc 0+dc 0+dc 2\*\*0
+ 2 \.dynstr 0+7 0+c8 0+c8 0+c8 2\*\*0
CONTENTS, ALLOC, LOAD, READONLY, DATA
- 3 \.text 0+4 0+e4 0+e4 0+e4 2\*\*1
+ 3 \.text 0+4 0+d0 0+d0 0+d0 2\*\*1
CONTENTS, ALLOC, LOAD, READONLY, CODE
- 4 \.dynamic 0+58 0+20e8 0+20e8 0+e8 2\*\*2
+ 4 \.dynamic 0+58 0+20d4 0+20d4 0+d4 2\*\*2
CONTENTS, ALLOC, LOAD, DATA
- 5 \.got 0+c 0+2140 0+2140 0+140 2\*\*2
+ 5 \.got 0+c 0+212c 0+212c 0+12c 2\*\*2
CONTENTS, ALLOC, LOAD, DATA
diff --git a/ld/testsuite/ld-cris/libdso-11.d b/ld/testsuite/ld-cris/libdso-11.d
index b8e3742..0e00ad6 100644
--- a/ld/testsuite/ld-cris/libdso-11.d
+++ b/ld/testsuite/ld-cris/libdso-11.d
@@ -8,20 +8,20 @@
DYNAMIC SYMBOL TABLE:
#...
-0+144 g DF \.text 0+8 dsofn3
+0+130 g DF \.text 0+8 dsofn3
#...
-0+140 g DF \.text 0+2 dsofn
+0+12c g DF \.text 0+2 dsofn
#...
Contents of section \.rela\.plt:
- 0100 d0210000 0b030000 00000000 .*
+.* bc210000 0b020000 00000000 .*
Contents of section \.plt:
- 010c 84e20401 7e7a3f7a 04f26ffa bf09b005 .*
- 011c 00000000 00000000 00006f0d 0c000000 .*
- 012c 6ffabf09 b0053f7e 00000000 bf0ed4ff .*
- 013c ffffb005 .*
+.* 84e20401 7e7a3f7a 04f26ffa bf09b005 .*
+.* 00000000 00000000 00006f0d 0c000000 .*
+.* 6ffabf09 b0053f7e 00000000 bf0ed4ff .*
+.* ffffb005 .*
Contents of section \.text:
- 0140 b0050000 bfbee2ff ffffb005 .*
+.* b0050000 bfbee2ff ffffb005 .*
Contents of section \.dynamic:
#...
Contents of section \.got:
- 21c4 4c210000 00000000 00000000 32010000 .*
+.* 38210000 00000000 00000000 1e010000 .*
diff --git a/ld/testsuite/ld-cris/libdso-13b.d b/ld/testsuite/ld-cris/libdso-13b.d
index 1afa0ea..cf8200e 100644
--- a/ld/testsuite/ld-cris/libdso-13b.d
+++ b/ld/testsuite/ld-cris/libdso-13b.d
@@ -8,7 +8,7 @@
# script hiding the function called pcrel-without-plt. There should
# be no warning, no relocations in the output and no TEXTREL marking.
-Dynamic section at offset 0x150 contains 9 entries:
+Dynamic section at offset .* contains 9 entries:
Tag Type Name/Value
0x00000004 \(HASH\) .*
0x00000005 \(STRTAB\) .*
diff --git a/ld/testsuite/ld-cris/libdso-14.d b/ld/testsuite/ld-cris/libdso-14.d
index a697e97..b87a5ce 100644
--- a/ld/testsuite/ld-cris/libdso-14.d
+++ b/ld/testsuite/ld-cris/libdso-14.d
@@ -7,11 +7,11 @@
# Checking that a bsr to a non-PLT-decorated nonvisible function
# doesn't make the DSO textrel.
-Dynamic section at offset 0x110 contains 6 entries:
+Dynamic section at offset .* contains 6 entries:
Tag[ ]+Type[ ]+Name/Value
0x0+4 \(HASH\)[ ]+0x94
- 0x0+5 \(STRTAB\)[ ]+0xf0
- 0x0+6 \(SYMTAB\)[ ]+0xb0
+ 0x0+5 \(STRTAB\)[ ]+0xdc
+ 0x0+6 \(SYMTAB\)[ ]+0xac
0x0+a \(STRSZ\)[ ]+14 \(bytes\)
0x0+b \(SYMENT\)[ ]+16 \(bytes\)
0x0+ \(NULL\)[ ]+0x0
diff --git a/ld/testsuite/ld-cris/libdso-15.d b/ld/testsuite/ld-cris/libdso-15.d
index 6a53b1f..e772fa3 100644
--- a/ld/testsuite/ld-cris/libdso-15.d
+++ b/ld/testsuite/ld-cris/libdso-15.d
@@ -10,15 +10,15 @@
DYNAMIC SYMBOL TABLE:
#...
-0+2238 g[ ]+DO .data[ ]+0+4 TST3[ ]+__expobj2
-0+1ba g[ ]+DF .text[ ]+0+2 TST3[ ]+__expfn2
-0+1ba w[ ]+DF .text[ ]+0+2 TST3[ ]+expfn2
-0+2238 w[ ]+DO .data[ ]+0+4 TST3[ ]+expobj2
+0+2220 g[ ]+DO .data[ ]+0+4 TST3[ ]+__expobj2
+0+1a2 g[ ]+DF .text[ ]+0+2 TST3[ ]+__expfn2
+0+1a2 w[ ]+DF .text[ ]+0+2 TST3[ ]+expfn2
+0+2220 w[ ]+DO .data[ ]+0+4 TST3[ ]+expobj2
#...
Contents of section .text:
- 01b8 0f050f05 .*
+.* 0f050f05 .*
#...
Contents of section .got:
- 222c bc210000 00000000 00000000 .*
+.* a4210000 00000000 00000000 .*
Contents of section .data:
- 2238 00000000 .*
+.* 00000000 .*
diff --git a/ld/testsuite/ld-cris/pic-gc-72.d b/ld/testsuite/ld-cris/pic-gc-72.d
index 65bd989..3c096ea 100644
--- a/ld/testsuite/ld-cris/pic-gc-72.d
+++ b/ld/testsuite/ld-cris/pic-gc-72.d
@@ -19,11 +19,11 @@ Contents of section .dynsym:
Contents of section .dynstr:
#...
Contents of section .text:
- 0121 0f050f05 .*
+.* 0f050f05 .*
Contents of section .dynamic:
- 2128 .*
+ 2114 .*
#...
Contents of section .got:
- 2180 28210000 00000000 00000000 .*
+.* 14210000 00000000 00000000 .*
Contents of section .data:
- 218c 00000000 .*
+.* 00000000 .*
diff --git a/ld/testsuite/ld-cris/pic-gc-73.d b/ld/testsuite/ld-cris/pic-gc-73.d
index 7f599b9..603ce45 100644
--- a/ld/testsuite/ld-cris/pic-gc-73.d
+++ b/ld/testsuite/ld-cris/pic-gc-73.d
@@ -17,10 +17,11 @@ Contents of section .dynsym:
Contents of section .dynstr:
#...
Contents of section .text:
- 0121 0f050f05 .*
+.* 0f050f05 .*
Contents of section .dynamic:
+ 2114 .*
#...
Contents of section .got:
- 2180 28210000 00000000 00000000 .*
+.* 14210000 00000000 00000000 .*
Contents of section .data:
- 218c 00000000 .*
+.* 00000000 .*
diff --git a/ld/testsuite/ld-cris/tls-gc-71.d b/ld/testsuite/ld-cris/tls-gc-71.d
index e32aada..343204e 100644
--- a/ld/testsuite/ld-cris/tls-gc-71.d
+++ b/ld/testsuite/ld-cris/tls-gc-71.d
@@ -15,15 +15,13 @@
filesz 0x0+80 memsz 0x0+80 flags r--
#...
DYNAMIC SYMBOL TABLE:
-0+132 l d \.text 0+ \.text
-0+2138 l d \.tdata 0+ \.tdata
-0+132 g DF \.text 0+2 _init
+0+10a g DF \.text 0+2 _init
0+ g D .tdata 0+80 tls128
DYNAMIC RELOCATION RECORDS \(none\)
#...
Contents of section \.text:
- 0132 0f050000 .*
+ 010a 0f050000 .*
#...
Contents of section \.got:
- 2218 b8210000 00000000 00000000 .*
+.* 90210000 00000000 00000000 .*