aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-elf
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2017-08-06 22:04:25 +0930
committerAlan Modra <amodra@gmail.com>2017-08-07 22:10:51 +0930
commitbab55c0522f47e692e367bfa341f4e19495cd8ad (patch)
treec2228f015424ed947c8bbdf528f02b79adf9ceab /ld/testsuite/ld-elf
parentb3293efaf8ddef1eba52de14be47e3d33bbce35a (diff)
downloadgdb-bab55c0522f47e692e367bfa341f4e19495cd8ad.zip
gdb-bab55c0522f47e692e367bfa341f4e19495cd8ad.tar.gz
gdb-bab55c0522f47e692e367bfa341f4e19495cd8ad.tar.bz2
Support different ld --hash-style in the ld testsuite
When ld is running with something other than --hash-style=sysv by default, numerous tests need tweaking. Most of the changes just add --hash-style=sysv. I didn't want to make --hash-style=sysv global as that means --hash-style=gnu isn't well tested. * testsuite/ld-alpha/alpha.exp: Add --hash-style=sysv to various test's ld options. * testsuite/ld-arm/arm-elf.exp: Likewise. * testsuite/ld-elf/elf.exp: Likewise. * testsuite/ld-elf/readelf.exp: Likewise. * testsuite/ld-elfvsb/elfvsb.exp: Likewise. * testsuite/ld-i386/i386.exp: Likewise. * testsuite/ld-ia64/ia64.exp: Likewise. * testsuite/ld-m68k/m68k.exp: Likewise. * testsuite/ld-metag/metag.exp: Likewise. * testsuite/ld-powerpc/powerpc.exp: Likewise. * testsuite/ld-s390/s390.exp: Likewise. * testsuite/ld-sh/sh-vxworks.exp: Likewise. * testsuite/ld-shared/shared.exp: Likewise. * testsuite/ld-sparc/sparc.exp: Likewise. * testsuite/ld-tic6x/tic6x.exp: Likewise. * testsuite/ld-vax-elf/vax-elf.exp: Likewise. * testsuite/ld-x86-64/mpx.exp: Likewise. * testsuite/ld-x86-64/x86-64.exp: Likewise. * testsuite/ld-xtensa/xtensa.exp: Likewise. * testsuite/ld-elf/comm-data2.ld: Add .gnu.hash output section. * testsuite/ld-elf/pr20828-v.ld: Likewise. * testsuite/ld-elf/pr20828.ld: Likewise. * testsuite/ld-elf/pr21233.ld: Likewise. * testsuite/ld-elf/pr21384.ld: Likewise. * testsuite/ld-elf/provide-hidden-1.ld: Likewise. * testsuite/ld-elf/provide-hidden-2.ld: Likewise. * testsuite/ld-elf/provide-hidden-s.ld: Likewise. * testsuite/ld-scripts/cross1.t: Likewise. * testsuite/ld-elf/stab.d: Adjust allowed section indices. * testsuite/ld-i386/pie1.d: Don't match addresses. * testsuite/ld-i386/plt-pic2.dd: Likewise. * testsuite/ld-i386/pr19636-1d.d: Likewise. * testsuite/ld-i386/pr19636-2c.d: Likewise. * testsuite/ld-powerpc/elfv2so.d: Likewise. * testsuite/ld-powerpc/tlsopt5.d: Likewise. * testsuite/ld-powerpc/tlsopt5.wf: Likewise. * testsuite/ld-powerpc/tlsopt5_32.d: Likewise. * testsuite/ld-i386/pr19636-2b.d: Don't match _start. * testsuite/ld-powerpc/ambiguousv1.d: Relax symbol count, index and address match. * testsuite/ld-powerpc/ambiguousv1b.d: Likewise. * testsuite/ld-powerpc/ambiguousv2.d: Likewise. * testsuite/ld-powerpc/ambiguousv2b.d: Likewise. * testsuite/ld-aarch64/gc-plt-relocs.d: Run ld with --hash-style=sysv. * testsuite/ld-aarch64/ifunc-1.d: Likewise. * testsuite/ld-aarch64/ifunc-2.d: Likewise. * testsuite/ld-aarch64/ifunc-21.d: Likewise. * testsuite/ld-aarch64/relasz.d: Likewise. * testsuite/ld-aarch64/tls-small-ld.d: Likewise. * testsuite/ld-aarch64/tls-tiny-ld.d: Likewise. * testsuite/ld-arc/tls_gd-01.d: Likewise. * testsuite/ld-cris/libdso-10.d: Likewise. * testsuite/ld-cris/libdso-2.d: Likewise. * testsuite/ld-cris/pic-gc-72.d: Likewise. * testsuite/ld-cris/pic-gc-73.d: Likewise. * testsuite/ld-cris/tls-gd-1.d: Likewise. * testsuite/ld-cris/tls-gd-1h.d: Likewise. * testsuite/ld-cris/tls-gd-2.d: Likewise. * testsuite/ld-cris/tls-gd-2h.d: Likewise. * testsuite/ld-cris/tls-ie-10.d: Likewise. * testsuite/ld-cris/tls-ie-11.d: Likewise. * testsuite/ld-cris/tls-ie-8.d: Likewise. * testsuite/ld-cris/tls-ie-9.d: Likewise. * testsuite/ld-cris/tls-ld-4.d: Likewise. * testsuite/ld-cris/tls-ld-5.d: Likewise. * testsuite/ld-cris/tls-ld-6.d: Likewise. * testsuite/ld-cris/tls-ld-7.d: Likewise. * testsuite/ld-cris/tls-ldgd-14.d: Likewise. * testsuite/ld-cris/tls-ldgd-15.d: Likewise. * testsuite/ld-cris/tls-ldgdx-14.d: Likewise. * testsuite/ld-cris/tls-ldgdx-15.d: Likewise. * testsuite/ld-cris/tls-local-54.d: Likewise. * testsuite/ld-cris/tls-local-60.d: Likewise. * testsuite/ld-cris/tls-local-61.d: Likewise. * testsuite/ld-cris/weakhiddso.d: Likewise. * testsuite/ld-elf/linkinfo1a.d: Likewise. * testsuite/ld-elf/linkinfo1b.d: Likewise. * testsuite/ld-elf/pr19617a.d: Likewise. * testsuite/ld-elfvsb/hidden2.d: Likewise. * testsuite/ld-frv/fdpic-pie-6.d: Likewise. * testsuite/ld-frv/fdpic-shared-2.d: Likewise. * testsuite/ld-frv/fdpic-shared-5.d: Likewise. * testsuite/ld-frv/fdpic-shared-6.d: Likewise. * testsuite/ld-frv/fdpic-shared-8.d: Likewise. * testsuite/ld-frv/fdpic-shared-local-2.d: Likewise. * testsuite/ld-frv/fdpic-shared-local-8.d: Likewise. * testsuite/ld-frv/tls-dynamic-2.d: Likewise. * testsuite/ld-i386/ibt-plt-1.d: Likewise. * testsuite/ld-i386/ibt-plt-2a.d: Likewise. * testsuite/ld-i386/ibt-plt-2c.d: Likewise. * testsuite/ld-i386/ibt-plt-3a.d: Likewise. * testsuite/ld-i386/ibt-plt-3c.d: Likewise. * testsuite/ld-i386/pr20830.d: Likewise. * testsuite/ld-ia64/merge1.d: Likewise. * testsuite/ld-ia64/merge2.d: Likewise. * testsuite/ld-ia64/merge3.d: Likewise. * testsuite/ld-ia64/merge4.d: Likewise. * testsuite/ld-ia64/merge5.d: Likewise. * testsuite/ld-ifunc/ifunc-1-local-x86.d: Likewise. * testsuite/ld-ifunc/ifunc-1-x86.d: Likewise. * testsuite/ld-ifunc/ifunc-2-i386-now.d: Likewise. * testsuite/ld-ifunc/ifunc-2-local-i386-now.d: Likewise. * testsuite/ld-ifunc/ifunc-2-local-x86-64-now.d: Likewise. * testsuite/ld-ifunc/ifunc-2-local-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-2-x86-64-now.d: Likewise. * testsuite/ld-ifunc/ifunc-2-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-3a-x86.d: Likewise. * testsuite/ld-ifunc/pr17154-i386-now.d: Likewise. * testsuite/ld-ifunc/pr17154-i386.d: Likewise. * testsuite/ld-ifunc/pr17154-x86-64-now.d: Likewise. * testsuite/ld-ifunc/pr17154-x86-64.d: Likewise. * testsuite/ld-m68k/got-1.d: Likewise. * testsuite/ld-m68k/got-multigot-12-13-14-34-35-ok.d: Likewise. * testsuite/ld-m68k/got-multigot-14-ok.d: Likewise. * testsuite/ld-m68k/got-multigot-15-er.d: Likewise. * testsuite/ld-m68k/got-negative-12-13-14-34-ok.d: Likewise. * testsuite/ld-m68k/got-negative-12-13-14-35-er.d: Likewise. * testsuite/ld-m68k/got-negative-14-ok.d: Likewise. * testsuite/ld-m68k/got-negative-15-er.d: Likewise. * testsuite/ld-m68k/got-single-12-ok.d: Likewise. * testsuite/ld-m68k/got-single-13-er.d: Likewise. * testsuite/ld-m68k/got-xgot-12-13-14-15-34-35-ok.d: Likewise. * testsuite/ld-m68k/got-xgot-15-ok.d: Likewise. * testsuite/ld-m68k/tls-gd-1.d: Likewise. * testsuite/ld-m68k/tls-gd-2.d: Likewise. * testsuite/ld-m68k/tls-gd-ie-1.d: Likewise. * testsuite/ld-m68k/tls-ie-1.d: Likewise. * testsuite/ld-m68k/tls-ld-1.d: Likewise. * testsuite/ld-m68k/tls-ld-2.d: Likewise. * testsuite/ld-sh/shared-2.d: Likewise. * testsuite/ld-sh/tlsbin-2.d: Likewise. * testsuite/ld-sh/tlspic-2.d: Likewise. * testsuite/ld-x86-64/bnd-branch-1-now.d: Likewise. * testsuite/ld-x86-64/bnd-ifunc-1-now.d: Likewise. * testsuite/ld-x86-64/bnd-ifunc-1.d: Likewise. * testsuite/ld-x86-64/bnd-ifunc-2-now.d: Likewise. * testsuite/ld-x86-64/bnd-ifunc-2.d: Likewise. * testsuite/ld-x86-64/bnd-plt-1-now.d: Likewise. * testsuite/ld-x86-64/bnd-plt-1.d: Likewise. * testsuite/ld-x86-64/ibt-plt-1-x32.d: Likewise. * testsuite/ld-x86-64/ibt-plt-1.d: Likewise. * testsuite/ld-x86-64/ibt-plt-2a-x32.d: Likewise. * testsuite/ld-x86-64/ibt-plt-2a.d: Likewise. * testsuite/ld-x86-64/ibt-plt-2c-x32.d: Likewise. * testsuite/ld-x86-64/ibt-plt-2c.d: Likewise. * testsuite/ld-x86-64/ibt-plt-3a-x32.d: Likewise. * testsuite/ld-x86-64/ibt-plt-3a.d: Likewise. * testsuite/ld-x86-64/ibt-plt-3c-x32.d: Likewise. * testsuite/ld-x86-64/ibt-plt-3c.d: Likewise. * testsuite/ld-x86-64/ilp32-4-nacl.d: Likewise. * testsuite/ld-x86-64/ilp32-4.d: Likewise. * testsuite/ld-x86-64/load1c-nacl.d: Likewise. * testsuite/ld-x86-64/load1c.d: Likewise. * testsuite/ld-x86-64/load1d-nacl.d: Likewise. * testsuite/ld-x86-64/load1d.d: Likewise. * testsuite/ld-x86-64/pie3-nacl.d: Likewise. * testsuite/ld-x86-64/pie3.d: Likewise. * testsuite/ld-x86-64/pr14207.d: Likewise. * testsuite/ld-x86-64/pr19162.d: Likewise. * testsuite/ld-x86-64/pr19636-2d-nacl.d: Likewise. * testsuite/ld-x86-64/pr19636-2d.d: Likewise. * testsuite/ld-x86-64/pr20253-1d.d: Likewise. * testsuite/ld-x86-64/pr20253-1f.d: Likewise. * testsuite/ld-x86-64/pr20253-1j.d: Likewise. * testsuite/ld-x86-64/pr20253-1l.d: Likewise. * testsuite/ld-x86-64/pr20830a-now.d: Likewise. * testsuite/ld-x86-64/pr20830a.d: Likewise. * testsuite/ld-x86-64/pr20830b-now.d: Likewise. * testsuite/ld-x86-64/pr20830b.d: Likewise. * testsuite/ld-x86-64/pr21038a-now.d: Likewise. * testsuite/ld-x86-64/pr21038a.d: Likewise. * testsuite/ld-x86-64/pr21038b-now.d: Likewise. * testsuite/ld-x86-64/pr21038b.d: Likewise. * testsuite/ld-x86-64/pr21038c-now.d: Likewise. * testsuite/ld-x86-64/pr21038c.d: Likewise.
Diffstat (limited to 'ld/testsuite/ld-elf')
-rw-r--r--ld/testsuite/ld-elf/comm-data2.ld1
-rw-r--r--ld/testsuite/ld-elf/elf.exp2
-rw-r--r--ld/testsuite/ld-elf/linkinfo1a.d2
-rw-r--r--ld/testsuite/ld-elf/linkinfo1b.d2
-rw-r--r--ld/testsuite/ld-elf/pr19617a.d2
-rw-r--r--ld/testsuite/ld-elf/pr20828-v.ld1
-rw-r--r--ld/testsuite/ld-elf/pr20828.ld1
-rw-r--r--ld/testsuite/ld-elf/pr21233.ld1
-rw-r--r--ld/testsuite/ld-elf/pr21384.ld1
-rw-r--r--ld/testsuite/ld-elf/provide-hidden-1.ld1
-rw-r--r--ld/testsuite/ld-elf/provide-hidden-2.ld1
-rw-r--r--ld/testsuite/ld-elf/provide-hidden-s.ld1
-rw-r--r--ld/testsuite/ld-elf/readelf.exp2
-rw-r--r--ld/testsuite/ld-elf/stab.d6
14 files changed, 16 insertions, 8 deletions
diff --git a/ld/testsuite/ld-elf/comm-data2.ld b/ld/testsuite/ld-elf/comm-data2.ld
index 3244453..ea1ac5b 100644
--- a/ld/testsuite/ld-elf/comm-data2.ld
+++ b/ld/testsuite/ld-elf/comm-data2.ld
@@ -9,6 +9,7 @@ SECTIONS
.rela.dyn : { *(.rela.*) }
.interp : { *(.interp) }
.hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
.dynsym : { *(.dynsym) }
.dynstr : { *(.dynstr) }
. = 0x76540000;
diff --git a/ld/testsuite/ld-elf/elf.exp b/ld/testsuite/ld-elf/elf.exp
index 80a8c42..655f0da 100644
--- a/ld/testsuite/ld-elf/elf.exp
+++ b/ld/testsuite/ld-elf/elf.exp
@@ -104,7 +104,7 @@ if { [check_shared_lib_support] } then {
setup_xfail "tic6x-*-*"
run_ld_link_tests {
{"Build shared library for next test"
- "-shared" "" "" "note-3.s" {} "note-3.so" }
+ "-shared --hash-style=sysv" "" "" "note-3.s" {} "note-3.so" }
{"Link using broken linker script"
"--script note-3.t tmpdir/note-3.so" "" "" ""
{ { ld "note-3.l" } }
diff --git a/ld/testsuite/ld-elf/linkinfo1a.d b/ld/testsuite/ld-elf/linkinfo1a.d
index b5ccf6f..1aeaf00 100644
--- a/ld/testsuite/ld-elf/linkinfo1a.d
+++ b/ld/testsuite/ld-elf/linkinfo1a.d
@@ -1,5 +1,5 @@
#source: linkinfo1.s
-#ld: -shared
+#ld: -shared --hash-style=sysv
#readelf: -SW
#target: x86_64-* i?86-*
diff --git a/ld/testsuite/ld-elf/linkinfo1b.d b/ld/testsuite/ld-elf/linkinfo1b.d
index cb17683..f8e3bd0 100644
--- a/ld/testsuite/ld-elf/linkinfo1b.d
+++ b/ld/testsuite/ld-elf/linkinfo1b.d
@@ -1,5 +1,5 @@
#source: linkinfo1.s
-#ld: -shared
+#ld: -shared --hash-style=sysv
#objcopy_linked_file: --strip-debug
#readelf: -SW
#target: x86_64-* i?86-*
diff --git a/ld/testsuite/ld-elf/pr19617a.d b/ld/testsuite/ld-elf/pr19617a.d
index 132021f..a565e29 100644
--- a/ld/testsuite/ld-elf/pr19617a.d
+++ b/ld/testsuite/ld-elf/pr19617a.d
@@ -1,5 +1,5 @@
#source: pr19617.s
-#ld: -E --no-dynamic-linker
+#ld: -E --no-dynamic-linker --hash-style=sysv
#readelf : --dyn-syms --wide
#target: *-*-linux* *-*-gnu* *-*-solaris*
diff --git a/ld/testsuite/ld-elf/pr20828-v.ld b/ld/testsuite/ld-elf/pr20828-v.ld
index cdba796..5800aa0 100644
--- a/ld/testsuite/ld-elf/pr20828-v.ld
+++ b/ld/testsuite/ld-elf/pr20828-v.ld
@@ -1,6 +1,7 @@
SECTIONS
{
.hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
.dynsym : { *(.dynsym) }
.dynstr : { *(.dynstr) }
.gnu.version : { *(.gnu.version) }
diff --git a/ld/testsuite/ld-elf/pr20828.ld b/ld/testsuite/ld-elf/pr20828.ld
index 034887d..9bea8d2 100644
--- a/ld/testsuite/ld-elf/pr20828.ld
+++ b/ld/testsuite/ld-elf/pr20828.ld
@@ -8,6 +8,7 @@ SECTIONS
}
.dynamic : { *(.dynamic) }
.hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
.dynsym : { *(.dynsym) }
.dynstr : { *(.dynstr) }
.gnu.version : { *(.gnu.version) }
diff --git a/ld/testsuite/ld-elf/pr21233.ld b/ld/testsuite/ld-elf/pr21233.ld
index a3b547b..03a28cc 100644
--- a/ld/testsuite/ld-elf/pr21233.ld
+++ b/ld/testsuite/ld-elf/pr21233.ld
@@ -1,6 +1,7 @@
SECTIONS
{
.hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
.dynsym : { *(.dynsym) }
.dynstr : { *(.dynstr) }
.rel.dyn : { *(.rel.dyn) }
diff --git a/ld/testsuite/ld-elf/pr21384.ld b/ld/testsuite/ld-elf/pr21384.ld
index 034887d..9bea8d2 100644
--- a/ld/testsuite/ld-elf/pr21384.ld
+++ b/ld/testsuite/ld-elf/pr21384.ld
@@ -8,6 +8,7 @@ SECTIONS
}
.dynamic : { *(.dynamic) }
.hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
.dynsym : { *(.dynsym) }
.dynstr : { *(.dynstr) }
.gnu.version : { *(.gnu.version) }
diff --git a/ld/testsuite/ld-elf/provide-hidden-1.ld b/ld/testsuite/ld-elf/provide-hidden-1.ld
index 479862d..ab10bc9 100644
--- a/ld/testsuite/ld-elf/provide-hidden-1.ld
+++ b/ld/testsuite/ld-elf/provide-hidden-1.ld
@@ -13,4 +13,5 @@ SECTIONS
.dynstr : { *(.dynstr) }
.dynamic : { *(.dynamic) }
.hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
}
diff --git a/ld/testsuite/ld-elf/provide-hidden-2.ld b/ld/testsuite/ld-elf/provide-hidden-2.ld
index 17e526b..3fc7513 100644
--- a/ld/testsuite/ld-elf/provide-hidden-2.ld
+++ b/ld/testsuite/ld-elf/provide-hidden-2.ld
@@ -9,4 +9,5 @@ SECTIONS
.dynstr : { *(.dynstr) }
.dynamic : { *(.dynamic) }
.hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
}
diff --git a/ld/testsuite/ld-elf/provide-hidden-s.ld b/ld/testsuite/ld-elf/provide-hidden-s.ld
index fc5761a..bd6aaf0 100644
--- a/ld/testsuite/ld-elf/provide-hidden-s.ld
+++ b/ld/testsuite/ld-elf/provide-hidden-s.ld
@@ -9,4 +9,5 @@ SECTIONS
.dynstr : { *(.dynstr) }
.dynamic : { *(.dynamic) }
.hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
}
diff --git a/ld/testsuite/ld-elf/readelf.exp b/ld/testsuite/ld-elf/readelf.exp
index 6831c19..82673f6 100644
--- a/ld/testsuite/ld-elf/readelf.exp
+++ b/ld/testsuite/ld-elf/readelf.exp
@@ -44,7 +44,7 @@ if [check_shared_lib_support] {
[list \
"readelf version information" \
"$LFLAGS --no-dynamic-linker -e 0 --export-dynamic -T ver_def.ld\
- --version-script=ver_def.ver" \
+ --hash-style=sysv --version-script=ver_def.ver" \
"" "" \
{ver_def.s} \
[list [list readelf --version-info ver_def$DUMP.vd]] \
diff --git a/ld/testsuite/ld-elf/stab.d b/ld/testsuite/ld-elf/stab.d
index 346640d..27b99cb 100644
--- a/ld/testsuite/ld-elf/stab.d
+++ b/ld/testsuite/ld-elf/stab.d
@@ -5,10 +5,10 @@
#notarget: "ia64-*-*" "alpha*"
# Disabled on alpha because the entry point may be above 4GB but the stabs
-# value on 32 bits.
+# value only 32 bits.
#...
- \[[0-9 ][0-9]\] \.stab +PROGBITS +0+ [0-9a-f]+ [0-9a-f]+ [0-9a-f]+ +[1-9]+ +0.*
+.* \.stab +PROGBITS +0+ [0-9a-f]+ [0-9a-f]+ [0-9a-f]+ +[1-9][0-9]* +0.*
#...
- \[[0-9 ][0-9]\] \.stabstr +STRTAB +0+ [0-9a-f]+ [0-9a-f]+ 00 +0 +0.*
+.* \.stabstr +STRTAB +0+ [0-9a-f]+ [0-9a-f]+ 00 +0 +0.*
#...