is_underscore_target for ld-elf tests
authorAlan Modra <amodra@gmail.com>
Sat, 17 Jun 2017 23:49:34 +0000 (09:19 +0930)
committerAlan Modra <amodra@gmail.com>
Sun, 18 Jun 2017 02:26:19 +0000 (11:56 +0930)
and correct targ_underscore in config.bfd

bfd/
* config.bfd: Correct targ_underscore for epiphany, ip2k,
m32c, mn10200, pru, rl78, rx, crisv32 and v850.
ld/
* testsuite/lib/ld-lib.exp (is_underscore_target): New.
* testsuite/ld-elf/elf.exp (ASFLAGS): Define UNDERSCORE.
* testsuite/ld-elf/pr21562a.s: If UNDERSCORE defined,
reference sym with prefix.
* testsuite/ld-elf/pr21562b.s: Likewise.
* testsuite/ld-elf/sizeof.s: Likewise.
* testsuite/ld-elf/startof.s: Likewise.
* testsuite/ld-elf/pr14156a.d: Adjust for extra symbols.
* testsuite/ld-elf/pr21562a.d: Remove underscore target from
xfails, and match prefixed symbol.
* testsuite/ld-elf/pr21562b.d: Likewise.
* testsuite/ld-elf/pr21562c.d: Likewise.
* testsuite/ld-elf/pr21562d.d: Likewise.
* testsuite/ld-elf/pr21562e.d: Likewise.
* testsuite/ld-elf/pr21562f.d: Likewise.
* testsuite/ld-elf/pr21562g.d: Likewise.
* testsuite/ld-elf/pr21562h.d: Likewise.
* testsuite/ld-elf/pr21562i.d: Likewise.
* testsuite/ld-elf/pr21562j.d: Likewise.
* testsuite/ld-elf/pr21562k.d: Likewise.
* testsuite/ld-elf/pr21562l.d: Likewise.
* testsuite/ld-elf/pr21562m.d: Likewise.
* testsuite/ld-elf/pr21562n.d: Likewise.
* testsuite/ld-elf/sizeofa.d: Likewise.
* testsuite/ld-elf/sizeofb.d: Likewise.
* testsuite/ld-elf/sizeofc.d: Likewise.
* testsuite/ld-elf/startofa.d: Likewise.
* testsuite/ld-elf/startofb.d: Likewise.
* testsuite/ld-elf/startofc.d: Likewise.

30 files changed:
bfd/ChangeLog
bfd/config.bfd
ld/ChangeLog
ld/testsuite/ld-elf/elf.exp
ld/testsuite/ld-elf/pr14156a.d
ld/testsuite/ld-elf/pr21562a.d
ld/testsuite/ld-elf/pr21562a.s
ld/testsuite/ld-elf/pr21562b.d
ld/testsuite/ld-elf/pr21562b.s
ld/testsuite/ld-elf/pr21562c.d
ld/testsuite/ld-elf/pr21562d.d
ld/testsuite/ld-elf/pr21562e.d
ld/testsuite/ld-elf/pr21562f.d
ld/testsuite/ld-elf/pr21562g.d
ld/testsuite/ld-elf/pr21562h.d
ld/testsuite/ld-elf/pr21562i.d
ld/testsuite/ld-elf/pr21562j.d
ld/testsuite/ld-elf/pr21562k.d
ld/testsuite/ld-elf/pr21562l.d
ld/testsuite/ld-elf/pr21562m.d
ld/testsuite/ld-elf/pr21562n.d
ld/testsuite/ld-elf/sizeof.s
ld/testsuite/ld-elf/sizeofa.d
ld/testsuite/ld-elf/sizeofb.d
ld/testsuite/ld-elf/sizeofc.d
ld/testsuite/ld-elf/startof.s
ld/testsuite/ld-elf/startofa.d
ld/testsuite/ld-elf/startofb.d
ld/testsuite/ld-elf/startofc.d
ld/testsuite/lib/ld-lib.exp

index c51dffc1dd1a02c8c4d286e438808d223dc18d93..f2f9b459f87b5822a401f016f777a8e2ad8502bd 100644 (file)
@@ -1,3 +1,8 @@
+2017-06-18  Alan Modra  <amodra@gmail.com>
+
+       * config.bfd: Correct targ_underscore for epiphany, ip2k,
+       m32c, mn10200, pru, rl78, rx, crisv32 and v850.
+
 2017-06-16  Nick Clifton  <nickc@redhat.com>
 
        * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Do not fail if the
index d0b509dc803d0751e69e6643044d551c6f9eff6c..f8a26f46cbc083f4dbdda184bac8e07f54725e19 100644 (file)
@@ -500,10 +500,15 @@ case "${targ}" in
     targ_underscore=yes
     ;;
 
-  cris-*-* | crisv32-*-*)
+  cris-*-*)
+    targ_defvec=cris_aout_vec
+    targ_selvecs="cris_elf32_us_vec cris_elf32_vec ieee_vec"
+    targ_underscore=yes
+    ;;
+
+  crisv32-*-*)
     targ_defvec=cris_aout_vec
     targ_selvecs="cris_elf32_us_vec cris_elf32_vec ieee_vec"
-    targ_underscore=yes # Note: not true for cris_elf32_vec.
     ;;
 
   crx-*-elf*)
@@ -526,6 +531,7 @@ case "${targ}" in
 
   epiphany-*-*)
     targ_defvec=epiphany_elf32_vec
+    targ_underscore=yes
     ;;
 
   fido-*-elf* )
@@ -913,6 +919,7 @@ case "${targ}" in
 
   ip2k-*-elf)
     targ_defvec=ip2k_elf32_vec
+    targ_underscore=yes
     ;;
 
   iq2000-*-elf)
@@ -931,6 +938,7 @@ case "${targ}" in
 
   m32c-*-elf | m32c-*-rtems*)
     targ_defvec=m32c_elf32_vec
+    targ_underscore=yes
     ;;
 
   m32r*le-*-linux*)
@@ -1231,6 +1239,7 @@ case "${targ}" in
 #endif
   mn10200-*-*)
     targ_defvec=mn10200_elf32_vec
+    targ_underscore=yes
     ;;
 
   mn10300-*-*)
@@ -1435,7 +1444,6 @@ case "${targ}" in
 
   pru-*-*)
     targ_defvec=pru_elf32_vec
-    targ_underscore=yes
     ;;
 
 #ifdef BFD64
@@ -1453,11 +1461,13 @@ case "${targ}" in
 
   rl78-*-elf)
     targ_defvec=rl78_elf32_vec
+    targ_underscore=yes
     ;;
 
   rx-*-elf)
     targ_defvec=rx_elf32_le_vec
     targ_selvecs="rx_elf32_be_vec rx_elf32_le_vec rx_elf32_be_ns_vec"
+    targ_underscore=yes
     ;;
 
   s390-*-linux*)
@@ -1767,6 +1777,7 @@ case "${targ}" in
   v850*-*-*)
     targ_defvec=v850_elf32_vec
     targ_selvecs="v800_elf32_vec"
+    targ_underscore=yes
     ;;
 
   vax-*-netbsdelf*)
index 583a936d0ba7e9f8e8eae8d60dcc193281351c8f..b16551f98e8500983c31f6f3ae95e82362ed391c 100644 (file)
@@ -1,3 +1,35 @@
+2017-06-18  Alan Modra  <amodra@gmail.com>
+
+       * testsuite/lib/ld-lib.exp (is_underscore_target): New.
+       * testsuite/ld-elf/elf.exp (ASFLAGS): Define UNDERSCORE.
+       * testsuite/ld-elf/pr21562a.s: If UNDERSCORE defined,
+       reference sym with prefix.
+       * testsuite/ld-elf/pr21562b.s: Likewise.
+       * testsuite/ld-elf/sizeof.s: Likewise.
+       * testsuite/ld-elf/startof.s: Likewise.
+       * testsuite/ld-elf/pr14156a.d: Adjust for extra symbols.
+       * testsuite/ld-elf/pr21562a.d: Remove underscore target from
+       xfails, and match prefixed symbol.
+       * testsuite/ld-elf/pr21562b.d: Likewise.
+       * testsuite/ld-elf/pr21562c.d: Likewise.
+       * testsuite/ld-elf/pr21562d.d: Likewise.
+       * testsuite/ld-elf/pr21562e.d: Likewise.
+       * testsuite/ld-elf/pr21562f.d: Likewise.
+       * testsuite/ld-elf/pr21562g.d: Likewise.
+       * testsuite/ld-elf/pr21562h.d: Likewise.
+       * testsuite/ld-elf/pr21562i.d: Likewise.
+       * testsuite/ld-elf/pr21562j.d: Likewise.
+       * testsuite/ld-elf/pr21562k.d: Likewise.
+       * testsuite/ld-elf/pr21562l.d: Likewise.
+       * testsuite/ld-elf/pr21562m.d: Likewise.
+       * testsuite/ld-elf/pr21562n.d: Likewise.
+       * testsuite/ld-elf/sizeofa.d: Likewise.
+       * testsuite/ld-elf/sizeofb.d: Likewise.
+       * testsuite/ld-elf/sizeofc.d: Likewise.
+       * testsuite/ld-elf/startofa.d: Likewise.
+       * testsuite/ld-elf/startofb.d: Likewise.
+       * testsuite/ld-elf/startofc.d: Likewise.
+
 2017-06-16  Alan Modra  <amodra@gmail.com>
 
        PR ld/20022
index f889070f5d8efb70f6cb2e86b49ad34058eab585..80a8c42bf9fca5e2d4a9040c5980f388fa9fd36e 100644 (file)
@@ -178,6 +178,10 @@ if { [check_shared_lib_support] } then {
            {pr20995a.s} {{readelf {-S --wide} pr20995.r}} "pr20995-2"]]
 }
 
+if [is_underscore_target] {
+    set ASFLAGS "$ASFLAGS --defsym UNDERSCORE=1"
+}
+
 set test_list [lsort [glob -nocomplain $srcdir/$subdir/*.d]]
 foreach t $test_list {
     # We need to strip the ".d", but can leave the dirname.
index efdc8461fb898ae2e489d3ca0e417dec233b6786..ffc6bfc55219e9cc6447e60cf2a4d5fdcc5bb634 100644 (file)
@@ -10,6 +10,7 @@
 #...
 [0-9a-f]+ T foo
 [0-9a-f]+ t foo1
+#...
 [0-9a-f]+ t foo2
 [0-9a-f]+ t foo3
 [0-9a-f]+ t last
index 1f57569d3ea8e71f2ceb68fc754d866eae829fd5..ecf013f432c579d9c81bac676ca24cf11f16e4ad 100644 (file)
@@ -3,14 +3,10 @@
 #target: *-*-linux* *-*-gnu*
 #xfail: d30v-*-* dlx-*-* i960-*-* pj*-*-*
 #xfail: hppa64-*-* i370-*-* i860-*-* ia64-*-* mep-*-* mn10200-*-*
-#xfail: bfin-*-* cr16-*-* cr16c-*-* crx-*-* epiphany-*-*
-#xfail: h8300-*-* ip2k-*-* mn10200-*-* mn10300-*-* m32c-*-* metag-*-*
-#xfail: rl78-*-* rx-*-* v850*-*-*
-# Targets with a leading char will fail this test.
 # generic linker targets don't support --gc-sections, nor do a bunch of others
 
 #...
   \[[ 0-9]+\] scnfoo[ \t]+PROGBITS[ \t]+[0-9a-f]+ +[0-9a-f]+ +0*10[ \t]+.*
 #...
- +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +LOCAL +DEFAULT +[0-9]+ +__start_scnfoo
+ +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +LOCAL +DEFAULT +[0-9]+ +___?start_scnfoo
 #pass
index ec36da4b8e5ed5b66a3fcf5f9ac0dcb1c395e030..a9ac1fb91d1405b23a6ea1105d288deae64f3c60 100644 (file)
@@ -5,4 +5,8 @@
         .data
         .type   bar, %object
 bar:
+  .ifdef UNDERSCORE
+        .dc.a   ___start_scnfoo
+  .else
         .dc.a   __start_scnfoo
+  .endif
index dd28b66ca695da092d7df301bdd434aef7f7d127..063a141741af8c71ff176f228af1d77715220c03 100644 (file)
@@ -3,14 +3,10 @@
 #target: *-*-linux* *-*-gnu*
 #xfail: d30v-*-* dlx-*-* i960-*-* pj*-*-*
 #xfail: hppa64-*-* i370-*-* i860-*-* ia64-*-* mep-*-* mn10200-*-*
-#xfail: bfin-*-* cr16-*-* cr16c-*-* crx-*-* epiphany-*-*
-#xfail: h8300-*-* ip2k-*-* mn10200-*-* mn10300-*-* m32c-*-* metag-*-*
-#xfail: rl78-*-* rx-*-* v850*-*-*
-# Targets with a leading char will fail this test.
 # generic linker targets don't support --gc-sections, nor do a bunch of others
 
 #...
   \[[ 0-9]+\] scnfoo[ \t]+PROGBITS[ \t]+[0-9a-f]+ +[0-9a-f]+ +0*10[ \t]+.*
 #...
- +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +LOCAL +DEFAULT +[0-9]+ +__stop_scnfoo
+ +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +LOCAL +DEFAULT +[0-9]+ +___?stop_scnfoo
 #pass
index 1732ee24b202ea38ac9d43fa3d765257e194b4e1..d79694c3d566b8641be8f152ece4fab64e6eea2b 100644 (file)
@@ -5,4 +5,8 @@
         .data
         .type   bar, %object
 bar:
+  .ifdef UNDERSCORE
+        .dc.a   ___stop_scnfoo
+  .else
         .dc.a   __stop_scnfoo
+  .endif
index 69eb6aacb4d6592dad67b1647f090fc8666cd92b..1d72a0d02f150229263da3cea89bacabe96dc250 100644 (file)
@@ -4,14 +4,10 @@
 #target: *-*-linux* *-*-gnu*
 #xfail: d30v-*-* dlx-*-* i960-*-* pj*-*-*
 #xfail: hppa64-*-* i370-*-* i860-*-* ia64-*-* mep-*-* mn10200-*-*
-#xfail: bfin-*-* cr16-*-* cr16c-*-* crx-*-* epiphany-*-*
-#xfail: h8300-*-* ip2k-*-* mn10200-*-* mn10300-*-* m32c-*-* metag-*-*
-#xfail: rl78-*-* rx-*-* v850*-*-*
-# Targets with a leading char will fail this test.
 # generic linker targets don't support --gc-sections, nor do a bunch of others
 
 #...
   \[[ 0-9]+\] scnfoo[ \t]+PROGBITS[ \t]+[0-9a-f]+ +[0-9a-f]+ +0*10[ \t]+.*
 #...
- +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +LOCAL +DEFAULT +[0-9]+ +__start_scnfoo
+ +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +LOCAL +DEFAULT +[0-9]+ +___?start_scnfoo
 #pass
index 7e1382190336e75c6e8a96019d6408becbe12f5b..f752a2465a2b532b44494eb0f67a1d265d70900d 100644 (file)
@@ -4,14 +4,10 @@
 #target: *-*-linux* *-*-gnu*
 #xfail: d30v-*-* dlx-*-* i960-*-* pj*-*-*
 #xfail: hppa64-*-* i370-*-* i860-*-* ia64-*-* mep-*-* mn10200-*-*
-#xfail: bfin-*-* cr16-*-* cr16c-*-* crx-*-* epiphany-*-*
-#xfail: h8300-*-* ip2k-*-* mn10200-*-* mn10300-*-* m32c-*-* metag-*-*
-#xfail: rl78-*-* rx-*-* v850*-*-*
-# Targets with a leading char will fail this test.
 # generic linker targets don't support --gc-sections, nor do a bunch of others
 
 #...
   \[[ 0-9]+\] scnfoo[ \t]+PROGBITS[ \t]+[0-9a-f]+ +[0-9a-f]+ +0*10[ \t]+.*
 #...
- +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +LOCAL +DEFAULT +[0-9]+ +__stop_scnfoo
+ +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +LOCAL +DEFAULT +[0-9]+ +___?stop_scnfoo
 #pass
index 0172a069d8b041d1eb736ffa647595d15ed195d0..769f2f8a4bdff284447e6c655e545436269b2d2d 100644 (file)
@@ -2,13 +2,9 @@
 #ld: -shared -z defs
 #readelf: -s -S --wide
 #target: *-*-linux* *-*-gnu*
-#xfail: bfin-*-* cr16-*-* cr16c-*-* crx-*-* epiphany-*-*
-#xfail: h8300-*-* ip2k-*-* mn10200-*-* mn10300-*-* m32c-*-* metag-*-*
-#xfail: rl78-*-* rx-*-* v850*-*-*
-# Targets with a leading char will fail this test.
 
 #...
   \[[ 0-9]+\] scnfoo[ \t]+PROGBITS[ \t]+[0-9a-f]+ +[0-9a-f]+ +0*10[ \t]+.*
 #...
- +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +LOCAL +DEFAULT +[0-9]+ +__start_scnfoo
+ +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +LOCAL +DEFAULT +[0-9]+ +___?start_scnfoo
 #pass
index a0f1a24d82a4fa2c8e1f9eafc65829b838bd426b..cb81c2a36bf118e6f2c791a2921542d03b5bc349 100644 (file)
@@ -2,13 +2,9 @@
 #ld: -shared -z defs
 #readelf: -s -S --wide
 #target: *-*-linux* *-*-gnu*
-#xfail: bfin-*-* cr16-*-* cr16c-*-* crx-*-* epiphany-*-*
-#xfail: h8300-*-* ip2k-*-* mn10200-*-* mn10300-*-* m32c-*-* metag-*-*
-#xfail: rl78-*-* rx-*-* v850*-*-*
-# Targets with a leading char will fail this test.
 
 #...
   \[[ 0-9]+\] scnfoo[ \t]+PROGBITS[ \t]+[0-9a-f]+ +[0-9a-f]+ +0*10[ \t]+.*
 #...
- +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +LOCAL +DEFAULT +[0-9]+ +__stop_scnfoo
+ +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +LOCAL +DEFAULT +[0-9]+ +___?stop_scnfoo
 #pass
index 289ab75191ba1ac33acedf0004b6bbe62fd18bcd..9926416abe9d97b34811c6b225c464bccd59a33f 100644 (file)
@@ -2,13 +2,9 @@
 #ld: -shared -z defs -T pr21562a.t
 #readelf: -s -S --wide
 #target: *-*-linux* *-*-gnu*
-#xfail: bfin-*-* cr16-*-* cr16c-*-* crx-*-* epiphany-*-*
-#xfail: h8300-*-* ip2k-*-* mn10200-*-* mn10300-*-* m32c-*-* metag-*-*
-#xfail: rl78-*-* rx-*-* v850*-*-*
-# Targets with a leading char will fail this test.
 
 #...
   \[[ 0-9]+\] scnfoo[ \t]+PROGBITS[ \t]+[0-9a-f]+ +[0-9a-f]+ +0*10[ \t]+.*
 #...
- +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +LOCAL +DEFAULT +[0-9]+ +__start_scnfoo
+ +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +LOCAL +DEFAULT +[0-9]+ +___?start_scnfoo
 #pass
index c94e63669f2930b772865eff1ce11e2e2f3b67a4..1e723ba099004f991aae9b7fe9b6aadfd5be3807 100644 (file)
@@ -2,13 +2,9 @@
 #ld: -shared -z defs -T pr21562a.t
 #readelf: -s -S --wide
 #target: *-*-linux* *-*-gnu*
-#xfail: bfin-*-* cr16-*-* cr16c-*-* crx-*-* epiphany-*-*
-#xfail: h8300-*-* ip2k-*-* mn10200-*-* mn10300-*-* m32c-*-* metag-*-*
-#xfail: rl78-*-* rx-*-* v850*-*-*
-# Targets with a leading char will fail this test.
 
 #...
   \[[ 0-9]+\] scnfoo[ \t]+PROGBITS[ \t]+[0-9a-f]+ +[0-9a-f]+ +0*10[ \t]+.*
 #...
- +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +LOCAL +DEFAULT +[0-9]+ +__stop_scnfoo
+ +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +LOCAL +DEFAULT +[0-9]+ +___?stop_scnfoo
 #pass
index 2670f60537d50e6042f7b5a518be11824d392522..f5b59c54b8b0f6748a28afa2c1a3841a15e3dd65 100644 (file)
@@ -4,14 +4,10 @@
 #target: *-*-linux* *-*-gnu*
 #xfail: d30v-*-* dlx-*-* i960-*-* pj*-*-*
 #xfail: hppa64-*-* i370-*-* i860-*-* ia64-*-* mep-*-* mn10200-*-*
-#xfail: bfin-*-* cr16-*-* cr16c-*-* crx-*-* epiphany-*-*
-#xfail: h8300-*-* ip2k-*-* mn10200-*-* mn10300-*-* m32c-*-* metag-*-*
-#xfail: rl78-*-* rx-*-* v850*-*-*
-# Targets with a leading char will fail this test.
 # generic linker targets don't support --gc-sections, nor do a bunch of others
 
 #...
   \[[ 0-9]+\] scnfoo[ \t]+PROGBITS[ \t]+[0-9a-f]+ +[0-9a-f]+ +0*10[ \t]+.*
 #...
- +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +LOCAL +DEFAULT +[0-9]+ +__start_scnfoo
+ +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +LOCAL +DEFAULT +[0-9]+ +___?start_scnfoo
 #pass
index 7c5508a5b43f568e71d5edd4b4685d69bdba9d2f..70e311e231d003e19f64445aec16a38cbaf09410 100644 (file)
@@ -4,14 +4,10 @@
 #target: *-*-linux* *-*-gnu*
 #xfail: d30v-*-* dlx-*-* i960-*-* pj*-*-*
 #xfail: hppa64-*-* i370-*-* i860-*-* ia64-*-* mep-*-* mn10200-*-*
-#xfail: bfin-*-* cr16-*-* cr16c-*-* crx-*-* epiphany-*-*
-#xfail: h8300-*-* ip2k-*-* mn10200-*-* mn10300-*-* m32c-*-* metag-*-*
-#xfail: rl78-*-* rx-*-* v850*-*-*
-# Targets with a leading char will fail this test.
 # generic linker targets don't support --gc-sections, nor do a bunch of others
 
 #...
   \[[ 0-9]+\] scnfoo[ \t]+PROGBITS[ \t]+[0-9a-f]+ +[0-9a-f]+ +0*10[ \t]+.*
 #...
- +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +LOCAL +DEFAULT +[0-9]+ +__stop_scnfoo
+ +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +LOCAL +DEFAULT +[0-9]+ +___?stop_scnfoo
 #pass
index 7f76d08c82c69ea6ba6d806c7a1bdf40dfe42573..4c62eb7966e65ea1cdf0612e93a35c078c2c6ade 100644 (file)
@@ -4,14 +4,10 @@
 #target: *-*-linux* *-*-gnu*
 #xfail: d30v-*-* dlx-*-* i960-*-* pj*-*-*
 #xfail: hppa64-*-* i370-*-* i860-*-* ia64-*-* mep-*-* mn10200-*-*
-#xfail: bfin-*-* cr16-*-* cr16c-*-* crx-*-* epiphany-*-*
-#xfail: h8300-*-* ip2k-*-* mn10200-*-* mn10300-*-* m32c-*-* metag-*-*
-#xfail: rl78-*-* rx-*-* v850*-*-*
-# Targets with a leading char will fail this test.
 # generic linker targets don't support --gc-sections, nor do a bunch of others
 
 #...
   \[[ 0-9]+\] \.foo[ \t]+PROGBITS[ \t]+[0-9a-f]+ +[0-9a-f]+ +0*10[ \t]+.*
 #...
- +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +LOCAL +DEFAULT +[0-9]+ +__start_scnfoo
+ +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +LOCAL +DEFAULT +[0-9]+ +___?start_scnfoo
 #pass
index 1ad601c554ea8fb13ec3d8c20b4825fb4b81424f..b0ba90dd3c00b1155352ee99631552fcef96a929 100644 (file)
@@ -4,14 +4,10 @@
 #target: *-*-linux* *-*-gnu*
 #xfail: d30v-*-* dlx-*-* i960-*-* pj*-*-*
 #xfail: hppa64-*-* i370-*-* i860-*-* ia64-*-* mep-*-* mn10200-*-*
-#xfail: bfin-*-* cr16-*-* cr16c-*-* crx-*-* epiphany-*-*
-#xfail: h8300-*-* ip2k-*-* mn10200-*-* mn10300-*-* m32c-*-* metag-*-*
-#xfail: rl78-*-* rx-*-* v850*-*-*
-# Targets with a leading char will fail this test.
 # generic linker targets don't support --gc-sections, nor do a bunch of others
 
 #...
   \[[ 0-9]+\] \.foo[ \t]+PROGBITS[ \t]+[0-9a-f]+ +[0-9a-f]+ +0*10[ \t]+.*
 #...
- +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +LOCAL +DEFAULT +[0-9]+ +__stop_scnfoo
+ +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +LOCAL +DEFAULT +[0-9]+ +___?stop_scnfoo
 #pass
index 2fedacdb5f8232a0c074dde0860f85f0e87a7603..fbcf76f4761eb591d8894ae3279092821d83e734 100644 (file)
@@ -4,14 +4,10 @@
 #target: *-*-linux* *-*-gnu*
 #xfail: d30v-*-* dlx-*-* i960-*-* pj*-*-*
 #xfail: hppa64-*-* i370-*-* i860-*-* ia64-*-* mep-*-* mn10200-*-*
-#xfail: bfin-*-* cr16-*-* cr16c-*-* crx-*-* epiphany-*-*
-#xfail: h8300-*-* ip2k-*-* mn10200-*-* mn10300-*-* m32c-*-* metag-*-*
-#xfail: rl78-*-* rx-*-* v850*-*-*
-# Targets with a leading char will fail this test.
 # generic linker targets don't support --gc-sections, nor do a bunch of others
 
 #...
   \[[ 0-9]+\] \.foo[ \t]+PROGBITS[ \t]+[0-9a-f]+ +[0-9a-f]+ +0*10[ \t]+.*
 #...
- +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +LOCAL +DEFAULT +[0-9]+ +__start_scnfoo
+ +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +LOCAL +DEFAULT +[0-9]+ +___?start_scnfoo
 #pass
index f12b23d7ea03941e8d579312f9496e4df3d6fe55..2453169999f48a7517a6cfdd487796484b995224 100644 (file)
@@ -4,14 +4,10 @@
 #target: *-*-linux* *-*-gnu*
 #xfail: d30v-*-* dlx-*-* i960-*-* pj*-*-*
 #xfail: hppa64-*-* i370-*-* i860-*-* ia64-*-* mep-*-* mn10200-*-*
-#xfail: bfin-*-* cr16-*-* cr16c-*-* crx-*-* epiphany-*-*
-#xfail: h8300-*-* ip2k-*-* mn10200-*-* mn10300-*-* m32c-*-* metag-*-*
-#xfail: rl78-*-* rx-*-* v850*-*-*
-# Targets with a leading char will fail this test.
 # generic linker targets don't support --gc-sections, nor do a bunch of others
 
 #...
   \[[ 0-9]+\] \.foo[ \t]+PROGBITS[ \t]+[0-9a-f]+ +[0-9a-f]+ +0*10[ \t]+.*
 #...
- +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +LOCAL +DEFAULT +[0-9]+ +__stop_scnfoo
+ +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +LOCAL +DEFAULT +[0-9]+ +___?stop_scnfoo
 #pass
index 016ac60fd1a2ee101af9c2af7b1a292a03235f2a..c275549cd4fc453f25bd61ee3983834f654a3100 100644 (file)
@@ -7,5 +7,9 @@
         .type   bar, %object
         .size   bar, 8
 bar:
+  .ifdef UNDERSCORE
+        .dc.a   ___stop_scnfoo
+  .else
         .dc.a   __stop_scnfoo
+  .endif
         .dc.a  .sizeof. (scnfoo)
index 340456de8a328868384e174c62b9877b6c5b55c2..fc64cf541119c8b4c7093693c964b2f94e395f94 100644 (file)
@@ -1,17 +1,12 @@
 #source: sizeof.s
 #ld: -Ur
 #readelf: -sW
-#xfail: bfin-*-* cr16-*-* cr16c-*-* cris*-*-elf crx-*-* epiphany-*-*
-#xfail: h8300-*-* ip2k-*-* mn10200-*-* mn10300-*-* m32c-*-* metag-*-*
-#xfail: rl78-*-* rx-*-* sh*-*-elf* sh*-*-kaos* sh*-*-nto* sh-*-rtems*
-#xfail: sh*-*-symbianelf* sh*-*-vxworks v850*-*-*
-# Targets with a leading char will fail this test.
 
 Symbol table '\.symtab' contains [0-9]+ entries:
  +Num: +Value +Size Type +Bind +Vis +Ndx Name
  +0: 0+ +0 +NOTYPE +LOCAL +DEFAULT +UND +
 #...
- +[0-9]+: +[a-f0-9]+ +0 +NOTYPE +(LOC|GLOB)AL +DEFAULT +[0-9]+ +__stop_scnfoo
+ +[0-9]+: +[a-f0-9]+ +0 +NOTYPE +(LOC|GLOB)AL +DEFAULT +[0-9]+ +___?stop_scnfoo
 #...
  +[0-9]+: +[a-f0-9]+ +0 +NOTYPE +GLOBAL +DEFAULT +UND +.sizeof.scnfoo
 #pass
index e25d88f06fe6e2832d28b9964ff2f9e0a47342cd..ac4a6a474e321f7f8da5d5af91cdfe5144a2f55d 100644 (file)
@@ -2,16 +2,12 @@
 #ld: -shared
 #readelf: -sW
 #target: *-*-linux* *-*-gnu*
-#xfail: bfin-*-* cr16-*-* cr16c-*-* crx-*-* epiphany-*-*
-#xfail: h8300-*-* ip2k-*-* mn10200-*-* mn10300-*-* m32c-*-* metag-*-*
-#xfail: rl78-*-* rx-*-* v850*-*-*
-# Targets with a leading char will fail this test.
 
 Symbol table '\.dynsym' contains [0-9]+ entries:
  +Num: +Value +Size Type +Bind +Vis +Ndx Name
  +0: 0+ +0 +NOTYPE +LOCAL +DEFAULT +UND +
 #...
- +[0-9]+: +[a-f0-9]+ +0 +NOTYPE +LOCAL +DEFAULT +[0-9]+ +__stop_scnfoo
+ +[0-9]+: +[a-f0-9]+ +0 +NOTYPE +LOCAL +DEFAULT +[0-9]+ +___?stop_scnfoo
 #...
  +[0-9]+: 0+10 + +0 +NOTYPE +LOCAL +DEFAULT +ABS +.sizeof.scnfoo
 #pass
index 1cff854b43953409d46356f6293fb2b019afb060..219caad107623e8a4a86ea383f4be59942d6dfc4 100644 (file)
@@ -6,7 +6,7 @@ Symbol table '\.symtab' contains [0-9]+ entries:
  +Num: +Value +Size Type +Bind +Vis +Ndx Name
  +0: 0+ +0 +NOTYPE +LOCAL +DEFAULT +UND +
 #...
- +[0-9]+: +[a-f0-9]+ +0 +NOTYPE +GLOBAL +DEFAULT +UND +__stop_scnfoo
+ +[0-9]+: +[a-f0-9]+ +0 +NOTYPE +GLOBAL +DEFAULT +UND +___?stop_scnfoo
 #...
  +[0-9]+: +[a-f0-9]+ +0 +NOTYPE +GLOBAL +DEFAULT +UND +.sizeof.scnfoo
 #pass
index 982f347a38313dc1d1f2382ce2f5ddeff559abd2..a1bb46554434bd23851441787a784209b518ea71 100644 (file)
@@ -7,5 +7,9 @@
         .type   bar, %object
         .size   bar, 8
 bar:
+  .ifdef UNDERSCORE
+        .dc.a   ___start_scnfoo
+  .else
         .dc.a   __start_scnfoo
+  .endif
         .dc.a  .startof. (scnfoo)
index 19ac29d2ee145e5b6068df0fce5c5a6b6e16d6ad..b0bf95b1a26dd9f77aa401655d73c7ee00bc2941 100644 (file)
@@ -1,17 +1,12 @@
 #source: startof.s
 #ld: -Ur
 #readelf: -sW
-#xfail: bfin-*-* cr16-*-* cr16c-*-* cris*-*-elf crx-*-* epiphany-*-*
-#xfail: h8300-*-* ip2k-*-* mn10200-*-* mn10300-*-* m32c-*-* metag-*-*
-#xfail: rl78-*-* rx-*-* sh*-*-elf* sh*-*-kaos* sh*-*-nto* sh-*-rtems*
-#xfail: sh*-*-symbianelf* sh*-*-vxworks v850*-*-*
-# Targets with a leading char will fail this test.
 
 Symbol table '\.symtab' contains [0-9]+ entries:
  +Num: +Value +Size Type +Bind +Vis +Ndx Name
  +0: 0+ +0 +NOTYPE +LOCAL +DEFAULT +UND +
 #...
- +[0-9]+: +[a-f0-9]+ +0 +NOTYPE +(LOCAL +DEFAULT +[0-9]+ +__start_scnfoo|GLOBAL +DEFAULT +UND +.startof.scnfoo)
+ +[0-9]+: +[a-f0-9]+ +0 +NOTYPE +(LOCAL +DEFAULT +[0-9]+ +___?start_scnfoo|GLOBAL +DEFAULT +UND +.startof.scnfoo)
 #...
- +[0-9]+: +[a-f0-9]+ +0 +NOTYPE +GLOBAL +DEFAULT +(UND +.startof.scnfoo|[0-9]+ +__start_scnfoo)
+ +[0-9]+: +[a-f0-9]+ +0 +NOTYPE +GLOBAL +DEFAULT +(UND +.startof.scnfoo|[0-9]+ +___?start_scnfoo)
 #pass
index 2cc1b86149013db78b8b78262a3296aabe3dbe4d..5d659bb8e5eae10a6ca61d8ac860c402053e4f6a 100644 (file)
@@ -2,10 +2,6 @@
 #ld: -shared
 #readelf: -sW
 #target: *-*-linux* *-*-gnu*
-#xfail: bfin-*-* cr16-*-* cr16c-*-* crx-*-* epiphany-*-*
-#xfail: h8300-*-* ip2k-*-* mn10200-*-* mn10300-*-* m32c-*-* metag-*-*
-#xfail: rl78-*-* rx-*-* v850*-*-*
-# Targets with a leading char will fail this test.
 
 Symbol table '\.dynsym' contains [0-9]+ entries:
  +Num: +Value +Size Type +Bind +Vis +Ndx Name
@@ -13,5 +9,5 @@ Symbol table '\.dynsym' contains [0-9]+ entries:
 #...
  +[0-9]+: +[a-f0-9]+ +0 +NOTYPE +LOCAL +DEFAULT +[0-9]+ +.startof.scnfoo
 #...
- +[0-9]+: +[a-f0-9]+ +0 +NOTYPE +LOCAL +DEFAULT +[0-9]+ +__start_scnfoo
+ +[0-9]+: +[a-f0-9]+ +0 +NOTYPE +LOCAL +DEFAULT +[0-9]+ +___?start_scnfoo
 #pass
index 4005625a0b85984363667c97081bf02a1c03d87a..6cde35aa057106cf518a1222bbe8cda1498a1ff2 100644 (file)
@@ -8,5 +8,5 @@ Symbol table '\.symtab' contains [0-9]+ entries:
 #...
  +[0-9]+: +[a-f0-9]+ +0 +NOTYPE +GLOBAL +DEFAULT +UND +.startof.scnfoo
 #...
- +[0-9]+: +[a-f0-9]+ +0 +NOTYPE +GLOBAL +DEFAULT +UND +__start_scnfoo
+ +[0-9]+: +[a-f0-9]+ +0 +NOTYPE +GLOBAL +DEFAULT +UND +___?start_scnfoo
 #pass
index aecc7008385ae6f1ad19694a8f472e8438fa6a7d..cddcaf834b272328e380bcb0bd9d32aebea068ee 100644 (file)
@@ -1858,6 +1858,25 @@ proc is_generic_elf { } {
     return 0;
 }
 
+proc is_underscore_target { } {
+    global is_underscore_target_saved
+    global target_triplet
+    global srcdir
+
+    if { ![info exists is_underscore_target_saved] } {
+       set cmd "targ=$target_triplet . $srcdir/../../bfd/config.bfd &&"
+       append cmd { echo "$targ_underscore"}
+       verbose -log "$cmd"
+       set status [catch {exec sh -c $cmd} result]
+       if { $status == 0 && [string match "yes" $result] } {
+           set is_underscore_target_saved 1
+       } else {
+           set is_underscore_target_saved 0
+       }
+    }
+    return $is_underscore_target_saved
+}
+
 # Returns true if the target ld supports the plugin API.
 proc check_plugin_api_available { } {
     global plugin_api_available_saved
This page took 0.057681 seconds and 4 git commands to generate.