From: Alan Modra Date: Fri, 24 Feb 2017 13:32:27 +0000 (+1030) Subject: Testsuite fixes for hppa64-hpux X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=dd803a2430a33ca5f306d717a7c242d2e907ae43;p=binutils-gdb.git 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. --- diff --git a/gas/ChangeLog b/gas/ChangeLog index 09f7771d9ed..b2908dc61c3 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2017-02-25 Alan Modra + + * testsuite/gas/elf/strtab.s: Don't put directives on first + column or continuation with labels not in first column. + 2017-02-24 Richard Sandiford * doc/c-aarch64.texi: Document that sve implies fp16, simd and compnum. diff --git a/gas/testsuite/gas/elf/strtab.s b/gas/testsuite/gas/elf/strtab.s index 931d9ef31df..d512a50d1b9 100644 --- a/gas/testsuite/gas/elf/strtab.s +++ b/gas/testsuite/gas/elf/strtab.s @@ -1,8 +1,14 @@ - .text -.globl x; x: -.globl xx; xx: -.globl xxx; xxx: -.globl xxxx; xxxx: -.globl xxxxx; xxxxx: -.globl xxxxxx; xxxxxx: + .text + .globl x +x: + .globl xx +xx: + .globl xxx +xxx: + .globl xxxx +xxxx: + .globl xxxxx +xxxxx: + .globl xxxxxx +xxxxxx: .byte 0 diff --git a/ld/ChangeLog b/ld/ChangeLog index 5236ae8a4a7..6e844a66c9a 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,24 @@ +2017-02-25 Alan Modra + + * 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. + 2017-02-24 Maciej W. Rozycki * testsuite/ld-elf/ver_def.d: New test. diff --git a/ld/testsuite/ld-elf/comm-data4.d b/ld/testsuite/ld-elf/comm-data4.d index 05c440132a6..024cfd8d7f8 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 ed17cf2d44c..60e0f3d6953 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 1605b8a05f2..2da32c71310 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 f13bb329ca1..09c9dda9c4c 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 3472154e186..86fda2114e7 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 5255c049c86..a614452633c 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 e4d527b2293..0e497aa95d8 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 06d08c16eb2..8eec3d2ca27 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 1e8c2baefd0..eccbcae71c1 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 a47b67beceb..acb33a97974 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 4fd76d5f7d9..38f150a589b 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 4f605c91a24..358dca6971b 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. diff --git a/ld/testsuite/ld-scripts/rgn-at10.d b/ld/testsuite/ld-scripts/rgn-at10.d index a1f6e0c1c9e..bd0623c5da8 100644 --- a/ld/testsuite/ld-scripts/rgn-at10.d +++ b/ld/testsuite/ld-scripts/rgn-at10.d @@ -1,6 +1,7 @@ #source: rgn-at10.s #ld: -T rgn-at10.t #objdump: -h --wide +#xfail: hppa*64*-*-hpux* # Test that lma is adjusted in case the section start vma is aligned and # lma_region != region if requested by script. Make sure this works with # non-load sections. diff --git a/ld/testsuite/ld-scripts/rgn-at11.d b/ld/testsuite/ld-scripts/rgn-at11.d index 900991fb824..ebfc420ee7a 100644 --- a/ld/testsuite/ld-scripts/rgn-at11.d +++ b/ld/testsuite/ld-scripts/rgn-at11.d @@ -1,6 +1,7 @@ #source: rgn-at11.s #ld: -T rgn-at11.t #objdump: -h --wide +#xfail: hppa*64*-*-hpux* # Test that lma is not adjusted in case the section start vma is aligned and # lma_region != region if not requested by script. # Fails for RX because it ignores the LMA (for compatibility with Renesas tools) diff --git a/ld/testsuite/ld-scripts/size-2.d b/ld/testsuite/ld-scripts/size-2.d index d76745ee8f9..e89bd5aeda4 100644 --- a/ld/testsuite/ld-scripts/size-2.d +++ b/ld/testsuite/ld-scripts/size-2.d @@ -1,7 +1,7 @@ #source: size-2.s #ld: -T size-2.t #readelf: -l --wide -#xfail: "hppa64-*-*" "v850*-*-*" +#xfail: "v850*-*-*" #... Program Headers: