[committed] MIPS/LD/testsuite: Correct dynamic links with VR4100, VR4300 and VR5000

H.J. Lu hjl.tools@gmail.com
Wed Mar 14 11:06:00 GMT 2018


On Wed, Jan 31, 2018 at 6:50 AM, Maciej W. Rozycki <macro@mips.com> wrote:
> Correct LD test suite failures with VR4100, VR4300 and VR5000 bare metal
> MIPS/ELF targets which do not default to linking with shared libraries,
> which leads to link failures like:
>
> .../ld/ld-new: cannot find -lcomm-data
> FAIL: Common symbol override test
>
> or:
>
> .../ld/ld-new: attempted static link of dynamic object `tmpdir/pr14170.so'
> FAIL: PR ld/14170
>
> removing:
>
> FAIL: Build pr22471b.so
> FAIL: Build pr22471
> FAIL: Build pr22649-2b.so
> FAIL: Build pr22649-2d.so
> FAIL: Build pr22150
> FAIL: PR ld/14170
> FAIL: --gc-sections with __gxx_personality
>
> test failures.
>
>         ld/
>         * testsuite/ld-elf/comm-data.exp: Pass `-call_shared' to links
>         involving a shared library for `mips*vr4100*-*-elf*',
>         `mips*vr4300*-*-elf*' and `mips*vr5000*-*-elf*' targets.
>         * testsuite/ld-elf/provide-hidden.exp: Likewise.
>         * testsuite/ld-elf/shared.exp: Likewise.
>         * testsuite/ld-gc/gc.exp: Likewise.
>         * testsuite/ld-mips-elf/comm-data.exp: Likewise.
> ---
> Hi,
>
>  Like with <https://sourceware.org/ml/binutils/2018-01/msg00425.html>
> (commit 86b24e15c45b ("MIPS/LD/testsuite: Correct comm-data.exp test
> ABI/emul/endian arrangement")) some remain due to a handling peculiarity
> with the IRIX format variation, e.g.:
>
> regexp_diff match failure
> regexp "^ +0x0*76540000 00000000 00000000 00000000 00000000 .*$"
> line   "  0x76540000 00000308 00000000 00000000 00000000 ................"
> FAIL: Common symbol override test
>
> Similarly <https://sourceware.org/ml/binutils/2018-01/msg00442.html>
> (commit af667f2218ec ("MIPS/LD/testsuite: Correct PR ld/22649 test case
> failures")) and the issue with `_procedure_table_size', e.g.:
>
> .../ld/ld-new: tmpdir/libpr20828.so: protected symbol `_procedure_table_size' isn't defined
> .../ld/ld-new: final link failed: Bad value
>
> And finally what looks like a linker script problem:
>
> .../ld/ld-new: tmpdir/provide-hidden-s.so: The first section in the PT_DYNAMIC segment is not the .dynamic section
> .../ld/ld-new: final link failed: Bad value
>
>  All these are independent problems however and I have now committed this
> fix.
>
>   Maciej
> ---
>  ld/testsuite/ld-elf/comm-data.exp      |    6 ++++++
>  ld/testsuite/ld-elf/provide-hidden.exp |   14 ++++++++++----
>  ld/testsuite/ld-elf/shared.exp         |   19 ++++++++++++++-----
>  ld/testsuite/ld-gc/gc.exp              |   10 +++++++++-
>  ld/testsuite/ld-mips-elf/comm-data.exp |    3 ++-
>  5 files changed, 41 insertions(+), 11 deletions(-)
>

> Index: binutils/ld/testsuite/ld-gc/gc.exp
> ===================================================================
> --- binutils.orig/ld/testsuite/ld-gc/gc.exp     2018-01-31 14:15:45.871840273 +0000
> +++ binutils/ld/testsuite/ld-gc/gc.exp  2018-01-31 14:16:12.850499318 +0000
> @@ -116,11 +116,18 @@ if { [is_elf_format] && [check_shared_li
>      if { [istarget tic6x-*] } then {
>         set gasopt "-mpic -mpid=near"
>      }
> +    # These targets do not default to linking with shared libraries.
> +    set old_ldflags $LDFLAGS
> +    if { [istarget "mips*vr4100*-*-elf*"] \
> +        || [istarget "mips*vr4300*-*-elf*"] \
> +        || [istarget "mips*vr5000*-*-elf*"] } {
> +       append LDFLAGS " -call_shared"
> +    }
>      if {![ld_assemble_flags $as $gasopt $srcdir/$subdir/libpersonality.s tmpdir/libpersonality.o]
>         || ![ld_link $ld tmpdir/libpersonality.so "-shared tmpdir/libpersonality.o"] } then {
>         fail libpersonality
>      } else {
> -       run_dump_test "personality"
> +       run_dump_test "personality" [list [list ld $LFLAGS]]

   ^^^^^^^^^ Typo.  This should be $LDFLAGS.

I will check in a fix:

diff --git a/ld/testsuite/ld-gc/gc.exp b/ld/testsuite/ld-gc/gc.exp
index a95d2d4900..efdddd7452 100644
--- a/ld/testsuite/ld-gc/gc.exp
+++ b/ld/testsuite/ld-gc/gc.exp
@@ -127,7 +127,7 @@ if { [is_elf_format] && [check_shared_lib_support] } then {
   || ![ld_link $ld tmpdir/libpersonality.so "-shared
tmpdir/libpersonality.o"] } then {
   fail libpersonality
     } else {
-  run_dump_test "personality" [list [list ld $LFLAGS]]
+  run_dump_test "personality" [list [list ld $LDFLAGS]]
     }
     run_dump_test "pr18223"
     if {![ld_assemble_flags $as $gasopt $srcdir/$subdir/pr20022a.s
tmpdir/pr20022a.o]

>      }
>      run_dump_test "pr18223"
>      if {![ld_assemble_flags $as $gasopt $srcdir/$subdir/pr20022a.s tmpdir/pr20022a.o]
> @@ -129,6 +136,7 @@ if { [is_elf_format] && [check_shared_li
>      } else {
>         run_dump_test "pr20022"
>      }
> +    set LDFLAGS $old_ldflags
>  }
>
>  if { [is_remote host] || [which $CC] != 0 } {


-- 
H.J.



More information about the Binutils mailing list