From bdd32e03c5e87bd38e63e9cc3fd35375241db58f Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Sun, 18 Jun 2017 09:19:34 +0930 Subject: is_underscore_target for ld-elf tests 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. --- bfd/ChangeLog | 5 +++++ bfd/config.bfd | 17 ++++++++++++++--- ld/ChangeLog | 32 ++++++++++++++++++++++++++++++++ ld/testsuite/ld-elf/elf.exp | 4 ++++ ld/testsuite/ld-elf/pr14156a.d | 1 + ld/testsuite/ld-elf/pr21562a.d | 6 +----- ld/testsuite/ld-elf/pr21562a.s | 4 ++++ ld/testsuite/ld-elf/pr21562b.d | 6 +----- ld/testsuite/ld-elf/pr21562b.s | 4 ++++ ld/testsuite/ld-elf/pr21562c.d | 6 +----- ld/testsuite/ld-elf/pr21562d.d | 6 +----- ld/testsuite/ld-elf/pr21562e.d | 6 +----- ld/testsuite/ld-elf/pr21562f.d | 6 +----- ld/testsuite/ld-elf/pr21562g.d | 6 +----- ld/testsuite/ld-elf/pr21562h.d | 6 +----- ld/testsuite/ld-elf/pr21562i.d | 6 +----- ld/testsuite/ld-elf/pr21562j.d | 6 +----- ld/testsuite/ld-elf/pr21562k.d | 6 +----- ld/testsuite/ld-elf/pr21562l.d | 6 +----- ld/testsuite/ld-elf/pr21562m.d | 6 +----- ld/testsuite/ld-elf/pr21562n.d | 6 +----- ld/testsuite/ld-elf/sizeof.s | 4 ++++ ld/testsuite/ld-elf/sizeofa.d | 7 +------ ld/testsuite/ld-elf/sizeofb.d | 6 +----- ld/testsuite/ld-elf/sizeofc.d | 2 +- ld/testsuite/ld-elf/startof.s | 4 ++++ ld/testsuite/ld-elf/startofa.d | 9 ++------- ld/testsuite/ld-elf/startofb.d | 6 +----- ld/testsuite/ld-elf/startofc.d | 2 +- ld/testsuite/lib/ld-lib.exp | 19 +++++++++++++++++++ 30 files changed, 112 insertions(+), 98 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index c51dffc..f2f9b45 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2017-06-18 Alan Modra + + * config.bfd: Correct targ_underscore for epiphany, ip2k, + m32c, mn10200, pru, rl78, rx, crisv32 and v850. + 2017-06-16 Nick Clifton * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Do not fail if the diff --git a/bfd/config.bfd b/bfd/config.bfd index d0b509d..f8a26f4 100644 --- a/bfd/config.bfd +++ b/bfd/config.bfd @@ -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*) diff --git a/ld/ChangeLog b/ld/ChangeLog index 583a936..b16551f 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,35 @@ +2017-06-18 Alan Modra + + * 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 PR ld/20022 diff --git a/ld/testsuite/ld-elf/elf.exp b/ld/testsuite/ld-elf/elf.exp index f889070..80a8c42 100644 --- a/ld/testsuite/ld-elf/elf.exp +++ b/ld/testsuite/ld-elf/elf.exp @@ -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. diff --git a/ld/testsuite/ld-elf/pr14156a.d b/ld/testsuite/ld-elf/pr14156a.d index efdc846..ffc6bfc 100644 --- a/ld/testsuite/ld-elf/pr14156a.d +++ b/ld/testsuite/ld-elf/pr14156a.d @@ -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 diff --git a/ld/testsuite/ld-elf/pr21562a.d b/ld/testsuite/ld-elf/pr21562a.d index 1f57569..ecf013f 100644 --- a/ld/testsuite/ld-elf/pr21562a.d +++ b/ld/testsuite/ld-elf/pr21562a.d @@ -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 diff --git a/ld/testsuite/ld-elf/pr21562a.s b/ld/testsuite/ld-elf/pr21562a.s index ec36da4..a9ac1fb 100644 --- a/ld/testsuite/ld-elf/pr21562a.s +++ b/ld/testsuite/ld-elf/pr21562a.s @@ -5,4 +5,8 @@ .data .type bar, %object bar: + .ifdef UNDERSCORE + .dc.a ___start_scnfoo + .else .dc.a __start_scnfoo + .endif diff --git a/ld/testsuite/ld-elf/pr21562b.d b/ld/testsuite/ld-elf/pr21562b.d index dd28b66..063a141 100644 --- a/ld/testsuite/ld-elf/pr21562b.d +++ b/ld/testsuite/ld-elf/pr21562b.d @@ -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 diff --git a/ld/testsuite/ld-elf/pr21562b.s b/ld/testsuite/ld-elf/pr21562b.s index 1732ee2..d79694c 100644 --- a/ld/testsuite/ld-elf/pr21562b.s +++ b/ld/testsuite/ld-elf/pr21562b.s @@ -5,4 +5,8 @@ .data .type bar, %object bar: + .ifdef UNDERSCORE + .dc.a ___stop_scnfoo + .else .dc.a __stop_scnfoo + .endif diff --git a/ld/testsuite/ld-elf/pr21562c.d b/ld/testsuite/ld-elf/pr21562c.d index 69eb6aa..1d72a0d 100644 --- a/ld/testsuite/ld-elf/pr21562c.d +++ b/ld/testsuite/ld-elf/pr21562c.d @@ -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 diff --git a/ld/testsuite/ld-elf/pr21562d.d b/ld/testsuite/ld-elf/pr21562d.d index 7e13821..f752a24 100644 --- a/ld/testsuite/ld-elf/pr21562d.d +++ b/ld/testsuite/ld-elf/pr21562d.d @@ -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 diff --git a/ld/testsuite/ld-elf/pr21562e.d b/ld/testsuite/ld-elf/pr21562e.d index 0172a06..769f2f8 100644 --- a/ld/testsuite/ld-elf/pr21562e.d +++ b/ld/testsuite/ld-elf/pr21562e.d @@ -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 diff --git a/ld/testsuite/ld-elf/pr21562f.d b/ld/testsuite/ld-elf/pr21562f.d index a0f1a24..cb81c2a 100644 --- a/ld/testsuite/ld-elf/pr21562f.d +++ b/ld/testsuite/ld-elf/pr21562f.d @@ -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 diff --git a/ld/testsuite/ld-elf/pr21562g.d b/ld/testsuite/ld-elf/pr21562g.d index 289ab75..9926416 100644 --- a/ld/testsuite/ld-elf/pr21562g.d +++ b/ld/testsuite/ld-elf/pr21562g.d @@ -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 diff --git a/ld/testsuite/ld-elf/pr21562h.d b/ld/testsuite/ld-elf/pr21562h.d index c94e636..1e723ba 100644 --- a/ld/testsuite/ld-elf/pr21562h.d +++ b/ld/testsuite/ld-elf/pr21562h.d @@ -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 diff --git a/ld/testsuite/ld-elf/pr21562i.d b/ld/testsuite/ld-elf/pr21562i.d index 2670f60..f5b59c5 100644 --- a/ld/testsuite/ld-elf/pr21562i.d +++ b/ld/testsuite/ld-elf/pr21562i.d @@ -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 diff --git a/ld/testsuite/ld-elf/pr21562j.d b/ld/testsuite/ld-elf/pr21562j.d index 7c5508a..70e311e 100644 --- a/ld/testsuite/ld-elf/pr21562j.d +++ b/ld/testsuite/ld-elf/pr21562j.d @@ -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 diff --git a/ld/testsuite/ld-elf/pr21562k.d b/ld/testsuite/ld-elf/pr21562k.d index 7f76d08..4c62eb7 100644 --- a/ld/testsuite/ld-elf/pr21562k.d +++ b/ld/testsuite/ld-elf/pr21562k.d @@ -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 diff --git a/ld/testsuite/ld-elf/pr21562l.d b/ld/testsuite/ld-elf/pr21562l.d index 1ad601c..b0ba90d 100644 --- a/ld/testsuite/ld-elf/pr21562l.d +++ b/ld/testsuite/ld-elf/pr21562l.d @@ -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 diff --git a/ld/testsuite/ld-elf/pr21562m.d b/ld/testsuite/ld-elf/pr21562m.d index 2fedacd..fbcf76f 100644 --- a/ld/testsuite/ld-elf/pr21562m.d +++ b/ld/testsuite/ld-elf/pr21562m.d @@ -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 diff --git a/ld/testsuite/ld-elf/pr21562n.d b/ld/testsuite/ld-elf/pr21562n.d index f12b23d..2453169 100644 --- a/ld/testsuite/ld-elf/pr21562n.d +++ b/ld/testsuite/ld-elf/pr21562n.d @@ -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 diff --git a/ld/testsuite/ld-elf/sizeof.s b/ld/testsuite/ld-elf/sizeof.s index 016ac60..c275549 100644 --- a/ld/testsuite/ld-elf/sizeof.s +++ b/ld/testsuite/ld-elf/sizeof.s @@ -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) diff --git a/ld/testsuite/ld-elf/sizeofa.d b/ld/testsuite/ld-elf/sizeofa.d index 340456d..fc64cf5 100644 --- a/ld/testsuite/ld-elf/sizeofa.d +++ b/ld/testsuite/ld-elf/sizeofa.d @@ -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 diff --git a/ld/testsuite/ld-elf/sizeofb.d b/ld/testsuite/ld-elf/sizeofb.d index e25d88f..ac4a6a4 100644 --- a/ld/testsuite/ld-elf/sizeofb.d +++ b/ld/testsuite/ld-elf/sizeofb.d @@ -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 diff --git a/ld/testsuite/ld-elf/sizeofc.d b/ld/testsuite/ld-elf/sizeofc.d index 1cff854..219caad 100644 --- a/ld/testsuite/ld-elf/sizeofc.d +++ b/ld/testsuite/ld-elf/sizeofc.d @@ -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 diff --git a/ld/testsuite/ld-elf/startof.s b/ld/testsuite/ld-elf/startof.s index 982f347..a1bb465 100644 --- a/ld/testsuite/ld-elf/startof.s +++ b/ld/testsuite/ld-elf/startof.s @@ -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) diff --git a/ld/testsuite/ld-elf/startofa.d b/ld/testsuite/ld-elf/startofa.d index 19ac29d..b0bf95b 100644 --- a/ld/testsuite/ld-elf/startofa.d +++ b/ld/testsuite/ld-elf/startofa.d @@ -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 diff --git a/ld/testsuite/ld-elf/startofb.d b/ld/testsuite/ld-elf/startofb.d index 2cc1b86..5d659bb 100644 --- a/ld/testsuite/ld-elf/startofb.d +++ b/ld/testsuite/ld-elf/startofb.d @@ -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 diff --git a/ld/testsuite/ld-elf/startofc.d b/ld/testsuite/ld-elf/startofc.d index 4005625..6cde35a 100644 --- a/ld/testsuite/ld-elf/startofc.d +++ b/ld/testsuite/ld-elf/startofc.d @@ -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 diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp index aecc700..cddcaf8 100644 --- a/ld/testsuite/lib/ld-lib.exp +++ b/ld/testsuite/lib/ld-lib.exp @@ -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 -- cgit v1.1