aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-tic6x
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2014-09-10 14:26:25 +0930
committerAlan Modra <amodra@gmail.com>2014-09-11 00:15:51 +0930
commita485e98ea0cbb61ea9da1e7858da545e0bcf1a46 (patch)
treee15a62480177db22789bdaf8ac4178a571e47619 /ld/testsuite/ld-tic6x
parent8efa9855823a78b8f465f39ddd8736266a6f31c4 (diff)
downloadgdb-a485e98ea0cbb61ea9da1e7858da545e0bcf1a46.zip
gdb-a485e98ea0cbb61ea9da1e7858da545e0bcf1a46.tar.gz
gdb-a485e98ea0cbb61ea9da1e7858da545e0bcf1a46.tar.bz2
Move ELF section headers to end of object file
Currently, section ordering differs a little for non-loaded reloc sections output by ld -emit-relocs or ld -r and that after passing such objects through objcopy. Not that it really matters, but it would be better for a simple objcopy to produce an unchanged output object file. Also, section headers are put somewhere in the middle of the non-loaded sections, again slightly differently for ld and objcopy. This patch fixes these discrepancies and puts section headers last, which is where gold puts them, and is where bfd_from_remote_memory wrongly assumed they will be found. bfd/ * elf.c (assign_file_positions_except_relocs): Move section header placement to.. (_bfd_elf_assign_file_positions_for_relocs): ..here. Make static. * elf-bfd.h (_bfd_elf_assign_file_positions_for_relocs): Delete. * elflink.c (bfd_elf_final_link): Don't call above function. gas/testsuite/ * gas/arm/got_prel.d: Adjust for changed section header placement. * gas/i386/ilp32/x86-64-size-1.d: Likewise. * gas/i386/ilp32/x86-64-size-3.d: Likewise. * gas/i386/ilp32/x86-64-size-5.d: Likewise. * gas/i386/ilp32/x86-64-unwind.d: Likewise. * gas/i386/size-1.d: Likewise. * gas/i386/size-3.d: Likewise. * gas/i386/x86-64-size-1.d: Likewise. * gas/i386/x86-64-size-3.d: Likewise. * gas/i386/x86-64-size-5.d: Likewise. * gas/i386/x86-64-unwind.d: Likewise. * gas/ia64/alias-ilp32.d: Likewise. * gas/ia64/alias.d: Likewise. * gas/ia64/group-1.d: Likewise. * gas/ia64/group-2.d: Likewise. * gas/ia64/secname-ilp32.d: Likewise. * gas/ia64/secname.d: Likewise. * gas/ia64/unwind-ilp32.d: Likewise. * gas/ia64/unwind.d: Likewise. * gas/mmix/bspec-1.d: Likewise. * gas/mmix/bspec-2.d: Likewise. * gas/mmix/byte-1.d: Likewise. * gas/mmix/loc-1.d: Likewise. * gas/mmix/loc-2.d: Likewise. * gas/mmix/loc-3.d: Likewise. * gas/mmix/loc-4.d: Likewise. * gas/mmix/loc-5.d: Likewise. * gas/tic6x/scomm-directive-4.d: Likewise. ld/testsuite/ * ld-aarch64/emit-relocs-local-addend.d: Adjust for changed section header placement. * ld-aarch64/local-addend-r.d: Likewise. * ld-mmix/bspec1.d: Likewise. * ld-mmix/bspec2.d: Likewise. * ld-mmix/local1.d: Likewise. * ld-mmix/local3.d: Likewise. * ld-mmix/local5.d: Likewise. * ld-mmix/local7.d: Likewise. * ld-mmix/undef-3.d: Likewise. * ld-sh/sh64/crange3-cmpct.rd: Likewise. * ld-sh/sh64/crange3-media.rd: Likewise. * ld-sh/sh64/crangerel1.rd: Likewise. * ld-sh/sh64/crangerel2.rd: Likewise. * ld-tic6x/common.d: Likewise. * ld-tic6x/shlib-1.rd: Likewise. * ld-tic6x/shlib-1b.rd: Likewise. * ld-tic6x/shlib-1r.rd: Likewise. * ld-tic6x/shlib-1rb.rd: Likewise. * ld-tic6x/shlib-app-1.rd: Likewise. * ld-tic6x/shlib-app-1b.rd: Likewise. * ld-tic6x/shlib-app-1r.rd: Likewise. * ld-tic6x/shlib-app-1rb.rd: Likewise. * ld-tic6x/shlib-noindex.rd: Likewise. * ld-tic6x/static-app-1.rd: Likewise. * ld-tic6x/static-app-1b.rd: Likewise. * ld-tic6x/static-app-1r.rd: Likewise. * ld-tic6x/static-app-1rb.rd: Likewise. * ld-x86-64/ilp32-4.d: Likewise. * ld-x86-64/split-by-file-nacl.rd: Likewise. * ld-x86-64/split-by-file.rd: Likewise.
Diffstat (limited to 'ld/testsuite/ld-tic6x')
-rw-r--r--ld/testsuite/ld-tic6x/common.d6
-rw-r--r--ld/testsuite/ld-tic6x/shlib-1.rd2
-rw-r--r--ld/testsuite/ld-tic6x/shlib-1b.rd2
-rw-r--r--ld/testsuite/ld-tic6x/shlib-1r.rd2
-rw-r--r--ld/testsuite/ld-tic6x/shlib-1rb.rd2
-rw-r--r--ld/testsuite/ld-tic6x/shlib-app-1.rd2
-rw-r--r--ld/testsuite/ld-tic6x/shlib-app-1b.rd2
-rw-r--r--ld/testsuite/ld-tic6x/shlib-app-1r.rd2
-rw-r--r--ld/testsuite/ld-tic6x/shlib-app-1rb.rd2
-rw-r--r--ld/testsuite/ld-tic6x/shlib-noindex.rd2
-rw-r--r--ld/testsuite/ld-tic6x/static-app-1.rd2
-rw-r--r--ld/testsuite/ld-tic6x/static-app-1b.rd2
-rw-r--r--ld/testsuite/ld-tic6x/static-app-1r.rd2
-rw-r--r--ld/testsuite/ld-tic6x/static-app-1rb.rd2
14 files changed, 16 insertions, 16 deletions
diff --git a/ld/testsuite/ld-tic6x/common.d b/ld/testsuite/ld-tic6x/common.d
index 68529f8..3a3942c 100644
--- a/ld/testsuite/ld-tic6x/common.d
+++ b/ld/testsuite/ld-tic6x/common.d
@@ -4,7 +4,7 @@
#source: common.s
#readelf: -Ss
-There are 6 section headers, starting at offset 0x7c:
+There are 6 section headers, starting at offset .*:
Section Headers:
\[Nr\] Name Type Addr Off Size ES Flg Lk Inf Al
@@ -12,8 +12,8 @@ Section Headers:
\[ 1\] \.far NOBITS 00000080 000080 000008 00 WA 0 0 4
\[ 2\] \.bss NOBITS 00000100 000080 000004 00 WA 0 0 4
\[ 3\] \.shstrtab STRTAB 00000000 000054 000025 00 0 0 1
- \[ 4\] \.symtab SYMTAB 00000000 00016c 000050 10 5 3 4
- \[ 5\] \.strtab STRTAB 00000000 0001bc 000005 00 0 0 1
+ \[ 4\] \.symtab SYMTAB 00000000 [0-9a-f]+ 000050 10 5 3 4
+ \[ 5\] \.strtab STRTAB 00000000 [0-9a-f]+ 000005 00 0 0 1
Key to Flags:
W \(write\), A \(alloc\), X \(execute\), M \(merge\), S \(strings\)
I \(info\), L \(link order\), G \(group\), T \(TLS\), E \(exclude\), x \(unknown\)
diff --git a/ld/testsuite/ld-tic6x/shlib-1.rd b/ld/testsuite/ld-tic6x/shlib-1.rd
index 1fe043b..2e0c830 100644
--- a/ld/testsuite/ld-tic6x/shlib-1.rd
+++ b/ld/testsuite/ld-tic6x/shlib-1.rd
@@ -1,4 +1,4 @@
-There are 17 section headers, starting at offset 0x21c4:
+There are 17 section headers, starting at offset .*:
Section Headers:
\[Nr\] Name Type Addr Off Size ES Flg Lk Inf Al
diff --git a/ld/testsuite/ld-tic6x/shlib-1b.rd b/ld/testsuite/ld-tic6x/shlib-1b.rd
index 1fe043b..2e0c830 100644
--- a/ld/testsuite/ld-tic6x/shlib-1b.rd
+++ b/ld/testsuite/ld-tic6x/shlib-1b.rd
@@ -1,4 +1,4 @@
-There are 17 section headers, starting at offset 0x21c4:
+There are 17 section headers, starting at offset .*:
Section Headers:
\[Nr\] Name Type Addr Off Size ES Flg Lk Inf Al
diff --git a/ld/testsuite/ld-tic6x/shlib-1r.rd b/ld/testsuite/ld-tic6x/shlib-1r.rd
index 1fe043b..2e0c830 100644
--- a/ld/testsuite/ld-tic6x/shlib-1r.rd
+++ b/ld/testsuite/ld-tic6x/shlib-1r.rd
@@ -1,4 +1,4 @@
-There are 17 section headers, starting at offset 0x21c4:
+There are 17 section headers, starting at offset .*:
Section Headers:
\[Nr\] Name Type Addr Off Size ES Flg Lk Inf Al
diff --git a/ld/testsuite/ld-tic6x/shlib-1rb.rd b/ld/testsuite/ld-tic6x/shlib-1rb.rd
index 1fe043b..2e0c830 100644
--- a/ld/testsuite/ld-tic6x/shlib-1rb.rd
+++ b/ld/testsuite/ld-tic6x/shlib-1rb.rd
@@ -1,4 +1,4 @@
-There are 17 section headers, starting at offset 0x21c4:
+There are 17 section headers, starting at offset .*:
Section Headers:
\[Nr\] Name Type Addr Off Size ES Flg Lk Inf Al
diff --git a/ld/testsuite/ld-tic6x/shlib-app-1.rd b/ld/testsuite/ld-tic6x/shlib-app-1.rd
index 74b090e..db1c560 100644
--- a/ld/testsuite/ld-tic6x/shlib-app-1.rd
+++ b/ld/testsuite/ld-tic6x/shlib-app-1.rd
@@ -1,4 +1,4 @@
-There are 18 section headers, starting at offset 0x2168:
+There are 18 section headers, starting at offset .*:
Section Headers:
\[Nr\] Name Type Addr Off Size ES Flg Lk Inf Al
diff --git a/ld/testsuite/ld-tic6x/shlib-app-1b.rd b/ld/testsuite/ld-tic6x/shlib-app-1b.rd
index 9c0610d..086f21a 100644
--- a/ld/testsuite/ld-tic6x/shlib-app-1b.rd
+++ b/ld/testsuite/ld-tic6x/shlib-app-1b.rd
@@ -1,4 +1,4 @@
-There are 18 section headers, starting at offset 0x2168:
+There are 18 section headers, starting at offset .*:
Section Headers:
\[Nr\] Name Type Addr Off Size ES Flg Lk Inf Al
diff --git a/ld/testsuite/ld-tic6x/shlib-app-1r.rd b/ld/testsuite/ld-tic6x/shlib-app-1r.rd
index 5cba27e..f09738c 100644
--- a/ld/testsuite/ld-tic6x/shlib-app-1r.rd
+++ b/ld/testsuite/ld-tic6x/shlib-app-1r.rd
@@ -1,4 +1,4 @@
-There are 17 section headers, starting at offset 0x2158:
+There are 17 section headers, starting at offset .*:
Section Headers:
\[Nr\] Name Type Addr Off Size ES Flg Lk Inf Al
diff --git a/ld/testsuite/ld-tic6x/shlib-app-1rb.rd b/ld/testsuite/ld-tic6x/shlib-app-1rb.rd
index 7119945..a49fc05 100644
--- a/ld/testsuite/ld-tic6x/shlib-app-1rb.rd
+++ b/ld/testsuite/ld-tic6x/shlib-app-1rb.rd
@@ -1,4 +1,4 @@
-There are 17 section headers, starting at offset 0x2158:
+There are 17 section headers, starting at offset .*:
Section Headers:
\[Nr\] Name Type Addr Off Size ES Flg Lk Inf Al
diff --git a/ld/testsuite/ld-tic6x/shlib-noindex.rd b/ld/testsuite/ld-tic6x/shlib-noindex.rd
index b4de2e5..3575d4c 100644
--- a/ld/testsuite/ld-tic6x/shlib-noindex.rd
+++ b/ld/testsuite/ld-tic6x/shlib-noindex.rd
@@ -1,4 +1,4 @@
-There are 18 section headers, starting at offset 0x21cc:
+There are 18 section headers, starting at offset .*:
Section Headers:
\[Nr\] Name Type Addr Off Size ES Flg Lk Inf Al
diff --git a/ld/testsuite/ld-tic6x/static-app-1.rd b/ld/testsuite/ld-tic6x/static-app-1.rd
index ebe3675..81a45f9 100644
--- a/ld/testsuite/ld-tic6x/static-app-1.rd
+++ b/ld/testsuite/ld-tic6x/static-app-1.rd
@@ -1,4 +1,4 @@
-There are 15 section headers, starting at offset 0x2180:
+There are 15 section headers, starting at offset .*:
Section Headers:
\[Nr\] Name Type Addr Off Size ES Flg Lk Inf Al
diff --git a/ld/testsuite/ld-tic6x/static-app-1b.rd b/ld/testsuite/ld-tic6x/static-app-1b.rd
index ebe3675..81a45f9 100644
--- a/ld/testsuite/ld-tic6x/static-app-1b.rd
+++ b/ld/testsuite/ld-tic6x/static-app-1b.rd
@@ -1,4 +1,4 @@
-There are 15 section headers, starting at offset 0x2180:
+There are 15 section headers, starting at offset .*:
Section Headers:
\[Nr\] Name Type Addr Off Size ES Flg Lk Inf Al
diff --git a/ld/testsuite/ld-tic6x/static-app-1r.rd b/ld/testsuite/ld-tic6x/static-app-1r.rd
index 66bde12..0ddcd63 100644
--- a/ld/testsuite/ld-tic6x/static-app-1r.rd
+++ b/ld/testsuite/ld-tic6x/static-app-1r.rd
@@ -1,4 +1,4 @@
-There are 15 section headers, starting at offset 0x2178:
+There are 15 section headers, starting at offset .*:
Section Headers:
\[Nr\] Name Type Addr Off Size ES Flg Lk Inf Al
diff --git a/ld/testsuite/ld-tic6x/static-app-1rb.rd b/ld/testsuite/ld-tic6x/static-app-1rb.rd
index 66bde12..0ddcd63 100644
--- a/ld/testsuite/ld-tic6x/static-app-1rb.rd
+++ b/ld/testsuite/ld-tic6x/static-app-1rb.rd
@@ -1,4 +1,4 @@
-There are 15 section headers, starting at offset 0x2178:
+There are 15 section headers, starting at offset .*:
Section Headers:
\[Nr\] Name Type Addr Off Size ES Flg Lk Inf Al