aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-elf
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2017-02-25 00:02:27 +1030
committerAlan Modra <amodra@gmail.com>2017-02-25 19:13:34 +1030
commitdd803a2430a33ca5f306d717a7c242d2e907ae43 (patch)
tree352434c3a627ffe0fd6ee933690b745094830ed8 /ld/testsuite/ld-elf
parent3b83ea38cfbc408da9c4a85a8db9a836fa098e93 (diff)
downloadgdb-dd803a2430a33ca5f306d717a7c242d2e907ae43.zip
gdb-dd803a2430a33ca5f306d717a7c242d2e907ae43.tar.gz
gdb-dd803a2430a33ca5f306d717a7c242d2e907ae43.tar.bz2
Testsuite fixes for hppa64-hpux
HPUX has a different .comm syntax, and anything in the first column is a label. gas/ * testsuite/gas/elf/strtab.s: Don't put directives on first column or continuation with labels not in first column. ld/ * testsuite/ld-elf/elf.exp: Xfail pr20995 tests on hppa64-hpux. Set up HPUX defsym. Run pr14170 tests and build symbol3 objects, defining HPUX where necessary. Define HPUX for implib tests. * testsuite/ld-elf/comm-data4.d: Run for hpux. * testsuite/ld-elf/endsym.d: Likewise. * testsuite/ld-elf/linkoncerdiff.d: Likewise. * testsuite/ld-elf/comm-data4.s: Add alternate .comm when HPUX. * testsuite/ld-elf/comm-data5.s: Likewise. * testsuite/ld-elf/endsym.s: Likewise. * testsuite/ld-elf/pr14170c.s: Likewise. * testsuite/ld-elf/symbol3.s: Likewise. * testsuite/ld-elf/implib.s: Likewise. Don't start directives in first column. * testsuite/ld-elf/linkoncerdiff2.s: Don't use numeric labels. * testsuite/ld-elf/warn3.d: Run for hpux. * testsuite/ld-scripts/rgn-at10.d: Xfail for hpux. * testsuite/ld-scripts/rgn-at11.d: Likewise. * testsuite/ld-scripts/size-2.d: Remove xfail for hpux.
Diffstat (limited to 'ld/testsuite/ld-elf')
-rw-r--r--ld/testsuite/ld-elf/comm-data4.d1
-rw-r--r--ld/testsuite/ld-elf/comm-data4.s6
-rw-r--r--ld/testsuite/ld-elf/comm-data5.s6
-rw-r--r--ld/testsuite/ld-elf/elf.exp89
-rw-r--r--ld/testsuite/ld-elf/endsym.d1
-rw-r--r--ld/testsuite/ld-elf/endsym.s9
-rw-r--r--ld/testsuite/ld-elf/implib.s8
-rw-r--r--ld/testsuite/ld-elf/linkoncerdiff.d1
-rw-r--r--ld/testsuite/ld-elf/linkoncerdiff2.s8
-rw-r--r--ld/testsuite/ld-elf/pr14170c.s4
-rw-r--r--ld/testsuite/ld-elf/symbol3.s6
-rw-r--r--ld/testsuite/ld-elf/warn3.d1
12 files changed, 86 insertions, 54 deletions
diff --git a/ld/testsuite/ld-elf/comm-data4.d b/ld/testsuite/ld-elf/comm-data4.d
index 05c4401..024cfd8 100644
--- a/ld/testsuite/ld-elf/comm-data4.d
+++ b/ld/testsuite/ld-elf/comm-data4.d
@@ -1,6 +1,5 @@
#source: comm-data4.s
#ld:
#readelf: -r
-#notarget: hppa64*-*-hpux*
There are no relocations in this file.
diff --git a/ld/testsuite/ld-elf/comm-data4.s b/ld/testsuite/ld-elf/comm-data4.s
index ed17cf2..60e0f3d 100644
--- a/ld/testsuite/ld-elf/comm-data4.s
+++ b/ld/testsuite/ld-elf/comm-data4.s
@@ -1,4 +1,8 @@
- .comm i,4,4
+ .ifdef HPUX
+i .comm 4
+ .else
+ .comm i,4,4
+ .endif
.data
.dc.a i
diff --git a/ld/testsuite/ld-elf/comm-data5.s b/ld/testsuite/ld-elf/comm-data5.s
index 1605b8a..2da32c7 100644
--- a/ld/testsuite/ld-elf/comm-data5.s
+++ b/ld/testsuite/ld-elf/comm-data5.s
@@ -1,4 +1,8 @@
- .comm i,4,4
+ .ifdef HPUX
+i .comm 4
+ .else
+ .comm i,4,4
+ .endif
.section .rodata,"a",%progbits
.dc.a i
diff --git a/ld/testsuite/ld-elf/elf.exp b/ld/testsuite/ld-elf/elf.exp
index f13bb32..09c9dda 100644
--- a/ld/testsuite/ld-elf/elf.exp
+++ b/ld/testsuite/ld-elf/elf.exp
@@ -29,6 +29,15 @@ set old_ldflags $LDFLAGS
if { [istarget spu*-*-*] } {
set LDFLAGS "$LDFLAGS --local-store 0:0"
}
+
+# hpux .comm differs from everyone else
+set hpux ""
+set old_asflags $ASFLAGS
+if [istarget "*-*-hpux*"] {
+ set hpux "--defsym HPUX=1"
+ set ASFLAGS "$ASFLAGS --defsym HPUX=1"
+}
+
if { [istarget alpha*-*-* ] } {
# The compress1 test is written expecting 32-bit addresses; force the
# executable down into the low address space to match.
@@ -52,33 +61,31 @@ if { [is_remote host] } then {
remote_download host merge.ld
}
-if { ![istarget hppa64*-hpux*] } {
+run_ld_link_tests [list \
+ [list "Build symbol3.a" \
+ "" "" $hpux \
+ {symbol3.s} {} "symbol3.a" ] \
+ [list "Build symbol3w.a" \
+ "" "" "" \
+ {symbol3w.s} {} "symbol3w.a" ] \
+]
+
+if { [check_shared_lib_support] } then {
run_ld_link_tests {
- {"Build symbol3.a"
- "" "" ""
- {symbol3.s} {} "symbol3.a"}
- {"Build symbol3w.a"
- "" "" ""
- {symbol3w.s} {} "symbol3w.a"}
+ {"Build pr14170a.o" "" "" "" {pr14170a.s} {} "pr14170.a" }
}
-
- if { [check_shared_lib_support] } then {
- run_ld_link_tests {
- {"Build pr14170a.o" "" "" "" "pr14170a.s" {} "pr14170.a" }
- }
- setup_xfail "tic6x-*-*"
- run_ld_link_tests {
- {"Build shared library for pr14170"
- "-shared" "" "" "pr14170b.s" {} "pr14170.so" }
- }
- # bfin does not currently support copy relocs.
- setup_xfail "bfin-*-*"
- run_ld_link_tests {
- {"PR ld/14170"
- "--no-dynamic-linker tmpdir/pr14170a.o tmpdir/pr14170.so" "" "" "pr14170c.s"
- { } "pr14170" }
- }
+ setup_xfail "tic6x-*-*"
+ run_ld_link_tests {
+ {"Build shared library for pr14170"
+ "-shared" "" "" "pr14170b.s" {} "pr14170.so" }
}
+ # bfin does not currently support copy relocs.
+ setup_xfail "bfin-*-*"
+ run_ld_link_tests [list \
+ [list "PR ld/14170" \
+ "--no-dynamic-linker tmpdir/pr14170a.o tmpdir/pr14170.so" "" $hpux \
+ {pr14170c.s} { } "pr14170" ] \
+ ]
}
# Only run these tests on targets that support creating shared libraries.
@@ -145,7 +152,7 @@ if { [check_shared_lib_support] } then {
# xfail on arm*-*-eabi*. The list can be enlarged to those targets that
# don't support GNU_RELRO. For more details, please see discussions at:
# https://sourceware.org/ml/binutils/2017-01/msg00441.html
- setup_xfail "arm*-*-eabi*"
+ setup_xfail "arm*-*-eabi*" "hppa*64*-*-hpux*"
run_ld_link_tests {
{"Build pr20995-2.so"
"-shared -z relro" "" ""
@@ -153,6 +160,8 @@ if { [check_shared_lib_support] } then {
}
# These targets don't copy dynamic variables into .bss.
setup_xfail "alpha-*-*" "bfin-*-*" "ia64-*-*" "xtensa-*-*"
+ # or don't have .data.rel.ro
+ setup_xfail "hppa*64*-*-hpux*"
run_ld_link_tests [list \
[list \
"pr20995" \
@@ -161,6 +170,7 @@ if { [check_shared_lib_support] } then {
# xfail on arm*-*-eabi* is particularly because of no support of GNU_RELRO.
# Please see the link above for details.
setup_xfail "alpha-*-*" "bfin-*-*" "ia64-*-*" "xtensa-*-*" "arm*-*-eabi*"
+ setup_xfail "hppa*64*-*-hpux*"
run_ld_link_tests [list \
[list \
"pr20995-2" \
@@ -183,20 +193,20 @@ if [is_generic_elf] {
}
# Check that the --out-implib option work correctly.
-run_ld_link_tests {
- {"Generate empty import library"
- "--out-implib=tmpdir/implib.lib" ""
- "--defsym NO_GLOBAL=1"
- {implib.s}
- {{ld empty-implib.out}}
- "implib"}
- {"Generate import library"
- "--out-implib=tmpdir/implib.lib" ""
- ""
- {implib.s}
- {{readelf {-s tmpdir/implib.lib} implib.rd}}
- "implib"}
-} $xfail_implib
+run_ld_link_tests [list \
+ [list "Generate empty import library" \
+ "--out-implib=tmpdir/implib.lib" "" \
+ [concat "--defsym NO_GLOBAL=1" $hpux] \
+ {implib.s} \
+ {{ld empty-implib.out}} \
+ "implib" ] \
+ [list "Generate import library" \
+ "--out-implib=tmpdir/implib.lib" "" \
+ $hpux \
+ {implib.s} \
+ {{readelf {-s tmpdir/implib.lib} implib.rd}} \
+ "implib" ] \
+] $xfail_implib
if { [istarget *-*-linux*]
|| [istarget *-*-nacl*]
@@ -233,6 +243,7 @@ if { [istarget *-*-*linux*]
}
set LDFLAGS $old_ldflags
+set ASFLAGS $old_asflags
# Check to see if the C compiler works
if { [which $CC] == 0 } {
diff --git a/ld/testsuite/ld-elf/endsym.d b/ld/testsuite/ld-elf/endsym.d
index 3472154..86fda21 100644
--- a/ld/testsuite/ld-elf/endsym.d
+++ b/ld/testsuite/ld-elf/endsym.d
@@ -2,7 +2,6 @@
#source: endsym.s
#ld: --sort-common
#nm: -n
-#notarget: hppa*-*-hpux*
#xfail: m68hc1*-* xgate-* cr16-*-* crx-*-* dlx-*-* nds32*-*-* visium-*-*
#xfail: pru-*-*
diff --git a/ld/testsuite/ld-elf/endsym.s b/ld/testsuite/ld-elf/endsym.s
index 5255c04..a614452 100644
--- a/ld/testsuite/ld-elf/endsym.s
+++ b/ld/testsuite/ld-elf/endsym.s
@@ -1,2 +1,7 @@
- .comm end,4,4
- .comm end2,2,2
+ .ifdef HPUX
+end .comm 4
+end2 .comm 2
+ .else
+ .comm end,4,4
+ .comm end2,2,2
+ .endif
diff --git a/ld/testsuite/ld-elf/implib.s b/ld/testsuite/ld-elf/implib.s
index e4d527b..0e497aa 100644
--- a/ld/testsuite/ld-elf/implib.s
+++ b/ld/testsuite/ld-elf/implib.s
@@ -1,5 +1,9 @@
-.ifndef NO_GLOBAL
+ .ifndef NO_GLOBAL
+ .ifdef HPUX
+exported1 .comm 1
+ .else
.comm exported1,1
+ .endif
.data
.global exported2
@@ -7,7 +11,7 @@
.size exported2, 1
exported2:
.byte 21
-.endif
+ .endif
.section ".bss", "aw", %nobits
not_exported1:
diff --git a/ld/testsuite/ld-elf/linkoncerdiff.d b/ld/testsuite/ld-elf/linkoncerdiff.d
index 06d08c1..8eec3d2 100644
--- a/ld/testsuite/ld-elf/linkoncerdiff.d
+++ b/ld/testsuite/ld-elf/linkoncerdiff.d
@@ -2,6 +2,5 @@
#source: linkoncerdiff2.s
#ld: -r
#readelf: -r
-#notarget: hppa64*-*-hpux*
There are no relocations in this file.
#pass
diff --git a/ld/testsuite/ld-elf/linkoncerdiff2.s b/ld/testsuite/ld-elf/linkoncerdiff2.s
index 1e8c2ba..eccbcae 100644
--- a/ld/testsuite/ld-elf/linkoncerdiff2.s
+++ b/ld/testsuite/ld-elf/linkoncerdiff2.s
@@ -1,22 +1,22 @@
.section .gnu.linkonce.t.foo, "a", %progbits
-1:
+.L1:
.globl symfoo
symfoo:
.long 0
.section .gnu.linkonce.t.bar, "a", %progbits
-2:
+.L2:
.globl symbar
symbar:
.long 0
.section .gnu.linkonce.r.foo, "a", %progbits
- .long 1b
+ .long .L1
.long symfoo
/* ld currently incorrectly silently discards this relocation. Just such
relocations are never produced by g++-3.4 so this suppressed error message
is not a problem:
#error: `.gnu.linkonce.t.bar' referenced in section `.gnu.linkonce.r.foo' of tmpdir/dump1.o: defined in discarded section `.gnu.linkonce.t.bar' of tmpdir/dump1.o
*/
- .long 2b
+ .long .L2
.long symbar
diff --git a/ld/testsuite/ld-elf/pr14170c.s b/ld/testsuite/ld-elf/pr14170c.s
index a47b67b..acb33a9 100644
--- a/ld/testsuite/ld-elf/pr14170c.s
+++ b/ld/testsuite/ld-elf/pr14170c.s
@@ -1,2 +1,6 @@
.hidden foo
+ .ifdef HPUX
+foo .comm 4
+ .else
.comm foo,4,4
+ .endif
diff --git a/ld/testsuite/ld-elf/symbol3.s b/ld/testsuite/ld-elf/symbol3.s
index 4fd76d5..38f150a 100644
--- a/ld/testsuite/ld-elf/symbol3.s
+++ b/ld/testsuite/ld-elf/symbol3.s
@@ -1 +1,5 @@
- .comm badsym,4
+ .ifdef HPUX
+badsym .comm 4
+ .else
+ .comm badsym,4
+ .endif
diff --git a/ld/testsuite/ld-elf/warn3.d b/ld/testsuite/ld-elf/warn3.d
index 4f605c9..358dca6 100644
--- a/ld/testsuite/ld-elf/warn3.d
+++ b/ld/testsuite/ld-elf/warn3.d
@@ -2,7 +2,6 @@
#ld: tmpdir/symbol3w.o tmpdir/symbol3.a
#warning: .*: warning: badsym warning$
#readelf: -s
-#notarget: hppa64*-hpux*
#xfail: d30v-*-* dlx-*-* i960-*-* pj*-*-*
# generic linker targets don't support .gnu.warning sections.