+2018-01-31 Maciej W. Rozycki <macro@mips.com>
+
+ * 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.
+
2018-01-31 Maciej W. Rozycki <macro@mips.com>
* testsuite/ld-elf/elf.exp: Move shared library tests over to...
if [istarget "tic6x-*-*"] {
append LFLAGS " -melf32_tic6x_le"
}
+# These targets do not default to linking with shared libraries.
+if { [istarget "mips*vr4100*-*-elf*"] \
+ || [istarget "mips*vr4300*-*-elf*"] \
+ || [istarget "mips*vr5000*-*-elf*"] } {
+ append LFLAGS " -call_shared"
+}
set testname "Common symbol override test"
if [istarget "tic6x-*-*"] {
append AFLAGS_PIC " -mpic -mpid=near"
}
+# These targets do not default to linking with shared libraries.
+if { [istarget "mips*vr4100*-*-elf*"] \
+ || [istarget "mips*vr4300*-*-elf*"] \
+ || [istarget "mips*vr5000*-*-elf*"] } {
+ append LFLAGS " -call_shared"
+}
set testname "PROVIDE_HIDDEN test"
"provide-hidden-3"] \
[list \
"$testname 4" \
- "-T provide-hidden-1.ld" "tmpdir/provide-hidden-s.so" \
+ "$LFLAGS -T provide-hidden-1.ld" "tmpdir/provide-hidden-s.so" \
"" \
[list provide-hidden-3.s] \
[list "readelf -s provide-hidden-dynsec.nd"] \
"provide-hidden-5"] \
[list \
"$testname 6" \
- "-T provide-hidden-1.ld" "tmpdir/provide-hidden-s.so" \
+ "$LFLAGS -T provide-hidden-1.ld" "tmpdir/provide-hidden-s.so" \
"" \
[list provide-hidden-4.s] \
[list \
"provide-hidden-9"] \
[list \
"$testname 10" \
- "-T provide-hidden-2.ld" "tmpdir/provide-hidden-s.so" \
+ "$LFLAGS -T provide-hidden-2.ld" "tmpdir/provide-hidden-s.so" \
"" \
[list provide-hidden-3.s] \
[list "readelf -s provide-hidden-dynabs.nd"] \
"provide-hidden-11"] \
[list \
"$testname 12" \
- "-T provide-hidden-2.ld" "tmpdir/provide-hidden-s.so" \
+ "$LFLAGS -T provide-hidden-2.ld" "tmpdir/provide-hidden-s.so" \
"" \
[list provide-hidden-4.s] \
[list \
if [istarget "*-*-hpux*"] {
set hpux "--defsym HPUX=1"
}
+# These targets do not default to linking with shared libraries.
+if { [istarget "mips*vr4100*-*-elf*"] \
+ || [istarget "mips*vr4300*-*-elf*"] \
+ || [istarget "mips*vr5000*-*-elf*"] } {
+ append LFLAGS " -call_shared"
+}
if [is_underscore_target] {
set ASFLAGS "$ASFLAGS --defsym UNDERSCORE=1"
# bfin does not currently support copy relocs.
run_ld_link_tests [list \
[list "PR ld/14170" \
- "--no-dynamic-linker tmpdir/pr14170a.o tmpdir/pr14170.so" "" $hpux \
+ "$LFLAGS --no-dynamic-linker tmpdir/pr14170a.o tmpdir/pr14170.so" "" \
+ $hpux \
{pr14170c.s} { } "pr14170" ] \
] "bfin-*-*"
{"Build shared library for broken linker scrip test"
"-shared --hash-style=sysv" "" "" "note-3.s" {} "note-3.so" }
{"Link using broken linker script"
- "--script note-3.t tmpdir/note-3.so" "" "" ""
+ "$LFLAGS --script note-3.t tmpdir/note-3.so" "" "" ""
{ { ld "note-3.l" } }
"a.out" }
}
# bfin does not currently support copy relocs.
run_ld_link_tests {
{"pr17068 link --as-needed lib in group"
- "--as-needed --no-dynamic-linker" "--start-group tmpdir/pr17068a.a tmpdir/pr17068.so tmpdir/pr17068b.a --end-group" ""
+ "$LFLAGS --as-needed --no-dynamic-linker"
+ "--start-group tmpdir/pr17068a.a tmpdir/pr17068.so tmpdir/pr17068b.a\
+ --end-group" ""
{start.s pr17068.s} {} "pr17068"}
} "bfin-*-*"
run_ld_link_tests [list \
[list \
"pr20995" \
- "" "tmpdir/pr20995.so" "$AFLAGS_NONPIC" \
+ "$LFLAGS" "tmpdir/pr20995.so" "$AFLAGS_NONPIC" \
{pr20995a.s} {{readelf {-S --wide} pr20995.r}} "pr20995"]]
# xfail on arm*-*-eabi* is particularly because of no support of GNU_RELRO.
run_ld_link_tests [list \
[list \
"pr20995-2" \
- "" "tmpdir/pr20995-2.so" "$AFLAGS_NONPIC" \
+ "$LFLAGS" "tmpdir/pr20995-2.so" "$AFLAGS_NONPIC" \
{pr20995a.s} {{readelf {-S --wide} pr20995.r}} "pr20995-2"]]
setup_xfail "tic6x-*-*"
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]]
}
run_dump_test "pr18223"
if {![ld_assemble_flags $as $gasopt $srcdir/$subdir/pr20022a.s tmpdir/pr20022a.o]
} else {
run_dump_test "pr20022"
}
+ set LDFLAGS $old_ldflags
}
if { [is_remote host] || [which $CC] != 0 } {
run_ld_link_tests [list \
[list \
"$testname" \
- "$LDFLAGS $ZFLAG -T ../ld-elf/comm-data2.ld -Ltmpdir -lmips-$abi-$reloc-comm-data" "" \
+ "$LDFLAGS -call_shared $ZFLAG -T ../ld-elf/comm-data2.ld -Ltmpdir\
+ -lmips-$abi-$reloc-comm-data" "" \
"$AFLAGS -call_nonpic" \
{ ../ld-elf/comm-data2.s } \
{ \