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 c51dffc..f2f9b45 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 d0b509d..f8a26f4 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 583a936..b16551f 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 f889070..80a8c42 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 efdc846..ffc6bfc 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 1f57569..ecf013f 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 ec36da4..a9ac1fb 100644 (file)
@@ -5,4 +5,8 @@
         .data
         .type   bar, %object
 bar:
+  .ifdef UNDERSCORE
+        .dc.a   ___start_scnfoo
+  .else
         .dc.a   __start_scnfoo
+  .endif
index dd28b66..063a141 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 1732ee2..d79694c 100644 (file)
@@ -5,4 +5,8 @@
         .data
         .type   bar, %object
 bar:
+  .ifdef UNDERSCORE
+        .dc.a   ___stop_scnfoo
+  .else
         .dc.a   __stop_scnfoo
+  .endif
index 69eb6aa..1d72a0d 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 7e13821..f752a24 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 0172a06..769f2f8 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 a0f1a24..cb81c2a 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 289ab75..9926416 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 c94e636..1e723ba 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 2670f60..f5b59c5 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 7c5508a..70e311e 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 7f76d08..4c62eb7 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 1ad601c..b0ba90d 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 2fedacd..fbcf76f 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 f12b23d..2453169 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 016ac60..c275549 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 340456d..fc64cf5 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 e25d88f..ac4a6a4 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 1cff854..219caad 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 982f347..a1bb465 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 19ac29d..b0bf95b 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 2cc1b86..5d659bb 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 4005625..6cde35a 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 aecc700..cddcaf8 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