Testsuite fixes for hppa64-hpux
authorAlan Modra <amodra@gmail.com>
Fri, 24 Feb 2017 13:32:27 +0000 (00:02 +1030)
committerAlan Modra <amodra@gmail.com>
Sat, 25 Feb 2017 08:43:34 +0000 (19:13 +1030)
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.

18 files changed:
gas/ChangeLog
gas/testsuite/gas/elf/strtab.s
ld/ChangeLog
ld/testsuite/ld-elf/comm-data4.d
ld/testsuite/ld-elf/comm-data4.s
ld/testsuite/ld-elf/comm-data5.s
ld/testsuite/ld-elf/elf.exp
ld/testsuite/ld-elf/endsym.d
ld/testsuite/ld-elf/endsym.s
ld/testsuite/ld-elf/implib.s
ld/testsuite/ld-elf/linkoncerdiff.d
ld/testsuite/ld-elf/linkoncerdiff2.s
ld/testsuite/ld-elf/pr14170c.s
ld/testsuite/ld-elf/symbol3.s
ld/testsuite/ld-elf/warn3.d
ld/testsuite/ld-scripts/rgn-at10.d
ld/testsuite/ld-scripts/rgn-at11.d
ld/testsuite/ld-scripts/size-2.d

index 09f7771..b2908dc 100644 (file)
@@ -1,3 +1,8 @@
+2017-02-25  Alan Modra  <amodra@gmail.com>
+
+       * 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  <richard.sandiford@arm.com>
 
        * doc/c-aarch64.texi: Document that sve implies fp16, simd and compnum.
index 931d9ef..d512a50 100644 (file)
@@ -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
index 5236ae8..6e844a6 100644 (file)
@@ -1,3 +1,24 @@
+2017-02-25  Alan Modra  <amodra@gmail.com>
+
+       * 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  <macro@imgtec.com>
 
        * testsuite/ld-elf/ver_def.d: New test.
index 05c4401..024cfd8 100644 (file)
@@ -1,6 +1,5 @@
 #source: comm-data4.s
 #ld: 
 #readelf: -r
-#notarget: hppa64*-*-hpux*
 
 There are no relocations in this file.
index ed17cf2..60e0f3d 100644 (file)
@@ -1,4 +1,8 @@
- .comm i,4,4
+ .ifdef HPUX
+i .comm 4
+ .else
+  .comm i,4,4
+ .endif
 
  .data
  .dc.a i
index 1605b8a..2da32c7 100644 (file)
@@ -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
index f13bb32..09c9dda 100644 (file)
@@ -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 } {
index 3472154..86fda21 100644 (file)
@@ -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-*-*
 
index 5255c04..a614452 100644 (file)
@@ -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
index e4d527b..0e497aa 100644 (file)
@@ -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:
index 06d08c1..8eec3d2 100644 (file)
@@ -2,6 +2,5 @@
 #source: linkoncerdiff2.s
 #ld: -r
 #readelf: -r
-#notarget: hppa64*-*-hpux*
 There are no relocations in this file.
 #pass
index 1e8c2ba..eccbcae 100644 (file)
@@ -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
index a47b67b..acb33a9 100644 (file)
@@ -1,2 +1,6 @@
        .hidden foo
+ .ifdef HPUX
+foo    .comm   4
+ .else
        .comm   foo,4,4
+ .endif
index 4fd76d5..38f150a 100644 (file)
@@ -1 +1,5 @@
-        .comm badsym,4
+ .ifdef HPUX
+badsym .comm 4
+ .else
+       .comm badsym,4
+ .endif
index 4f605c9..358dca6 100644 (file)
@@ -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.
 
index a1f6e0c..bd0623c 100644 (file)
@@ -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.
index 900991f..ebfc420 100644 (file)
@@ -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)
index d76745e..e89bd5a 100644 (file)
@@ -1,7 +1,7 @@
 #source: size-2.s
 #ld: -T size-2.t
 #readelf: -l --wide
-#xfail: "hppa64-*-*" "v850*-*-*"
+#xfail: "v850*-*-*"
 
 #...
 Program Headers: