From: Alan Modra Date: Thu, 4 Jun 2020 03:11:46 +0000 (+0930) Subject: ld-dynamic test fixes X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a0c0ad56704002e6438bdd077378de8d8cc1e1a9;p=binutils-gdb.git ld-dynamic test fixes * testsuite/ld-dynamic/export-dynamic-symbol-2.d: Match output for mips-sgi-irix6. * testsuite/ld-dynamic/export-dynamic-symbol-glob.d: Likewise. * testsuite/ld-dynamic/export-dynamic-symbol-list-2.d: Likewise. * testsuite/ld-dynamic/export-dynamic-symbol-list-glob.d: Likewise. * testsuite/ld-dynamic/export-dynamic-symbol.exp: Exclude targets with poor PIE support. --- diff --git a/ld/ChangeLog b/ld/ChangeLog index 363685d39c6..518d40ce4f3 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,13 @@ +2020-06-04 Alan Modra + + * testsuite/ld-dynamic/export-dynamic-symbol-2.d: Match output for + mips-sgi-irix6. + * testsuite/ld-dynamic/export-dynamic-symbol-glob.d: Likewise. + * testsuite/ld-dynamic/export-dynamic-symbol-list-2.d: Likewise. + * testsuite/ld-dynamic/export-dynamic-symbol-list-glob.d: Likewise. + * testsuite/ld-dynamic/export-dynamic-symbol.exp: Exclude targets + with poor PIE support. + 2020-06-04 Alan Modra * testsuite/ld-plugin/lto.exp (pr12758.exe): Add NOPIE_LDFLAGS. diff --git a/ld/testsuite/ld-dynamic/export-dynamic-symbol-2.d b/ld/testsuite/ld-dynamic/export-dynamic-symbol-2.d index d38508a5b5a..eaffc3ae39e 100644 --- a/ld/testsuite/ld-dynamic/export-dynamic-symbol-2.d +++ b/ld/testsuite/ld-dynamic/export-dynamic-symbol-2.d @@ -2,8 +2,11 @@ #source: export-dynamic-symbol.s #ld: -pie -u foo --export-dynamic-symbol foo --export-dynamic-symbol=bar tmpdir/libpr25910.a #nm: -D +# mips-sgi-irix6 makes foo and bar SHN_MIPS_DATA (SHN_LOPROC+2) due to the +# testcase carelessly leaving them untyped which mips gas turns into +# STT_OBJECT type. nm interprets SHN_MIPS_DATA (incorrectly) to be A type. #... -[0-9a-f]+ T +bar -[0-9a-f]+ T +foo +[0-9a-f]+ [AT] +bar +[0-9a-f]+ [AT] +foo #... diff --git a/ld/testsuite/ld-dynamic/export-dynamic-symbol-glob.d b/ld/testsuite/ld-dynamic/export-dynamic-symbol-glob.d index f8187be75c7..fad6da9e3f0 100644 --- a/ld/testsuite/ld-dynamic/export-dynamic-symbol-glob.d +++ b/ld/testsuite/ld-dynamic/export-dynamic-symbol-glob.d @@ -2,7 +2,8 @@ #source: export-dynamic-symbol.s #ld: -pie -u foo --export-dynamic-symbol "f*" tmpdir/libpr25910.a #nm: -D +# See comment in export-dynamic-symbol-2.d for why A is allowed here. #... -[0-9a-f]+ T +foo +[0-9a-f]+ [AT] +foo #... diff --git a/ld/testsuite/ld-dynamic/export-dynamic-symbol-list-2.d b/ld/testsuite/ld-dynamic/export-dynamic-symbol-list-2.d index 337f642ee9e..2d110a16cdb 100644 --- a/ld/testsuite/ld-dynamic/export-dynamic-symbol-list-2.d +++ b/ld/testsuite/ld-dynamic/export-dynamic-symbol-list-2.d @@ -2,8 +2,9 @@ #source: export-dynamic-symbol.s #ld: -pie -u foo --export-dynamic-symbol-list foo-bar.list tmpdir/libpr25910.a #nm: -D +# See comment in export-dynamic-symbol-2.d for why A is allowed here. #... -[0-9a-f]+ T +bar -[0-9a-f]+ T +foo +[0-9a-f]+ [AT] +bar +[0-9a-f]+ [AT] +foo #... diff --git a/ld/testsuite/ld-dynamic/export-dynamic-symbol-list-glob.d b/ld/testsuite/ld-dynamic/export-dynamic-symbol-list-glob.d index 916a22ca239..2a79d2046fb 100644 --- a/ld/testsuite/ld-dynamic/export-dynamic-symbol-list-glob.d +++ b/ld/testsuite/ld-dynamic/export-dynamic-symbol-list-glob.d @@ -2,7 +2,8 @@ #source: export-dynamic-symbol.s #ld: -pie -u foo --export-dynamic-symbol-list fstar.list tmpdir/libpr25910.a #nm: -D +# See comment in export-dynamic-symbol-2.d for why A is allowed here. #... -[0-9a-f]+ T +foo +[0-9a-f]+ [AT] +foo #... diff --git a/ld/testsuite/ld-dynamic/export-dynamic-symbol.exp b/ld/testsuite/ld-dynamic/export-dynamic-symbol.exp index ae530361fb1..44bd7628633 100644 --- a/ld/testsuite/ld-dynamic/export-dynamic-symbol.exp +++ b/ld/testsuite/ld-dynamic/export-dynamic-symbol.exp @@ -23,9 +23,16 @@ if ![is_elf_format] { return } -# Skip targets where -shared is not supported +# Skip targets where -shared or -pie is not supported +if { ![check_shared_lib_support] || ![check_pie_support] } { + return +} -if ![check_shared_lib_support] { +# Skip targets that have poor PIE support, resulting in failures due to +# PHDR segment not covered by LOAD segment errors. +if { ([istarget "bfin-*-*"] && ![istarget "bfin-*-linux*"]) + || [istarget "mn10300-*-*"] + || [istarget "score-*-*"] } { return }