+2021-02-03 Alan Modra <amodra@gmail.com>
+
+ PR 27311
+ * elflink.c (elf_link_add_object_symbols): Don't pull in as-needed
+ libraries when H is an indirect symbol after calling
+ _bfd_elf_add_default_symbol.
+
2021-01-28 Alan Modra <amodra@gmail.com>
PR 27259
+2021-02-03 Alan Modra <amodra@gmail.com>
+
+ Apply from mainline
+ 2021-02-03 Alan Modra <amodra@gmail.com>
+ * testsuite/ld-ifunc/ifunc.exp (libpr16467b.so, libpr16467bn.so):
+ Link with --as-needed.
+
+ 2021-02-02 Alan Modra <amodra@gmail.com>
+ * testsuite/ld-plugin/pr27311.d,
+ * testsuite/ld-plugin/pr27311.ver,
+ * testsuite/ld-plugin/pr27311a.c,
+ * testsuite/ld-plugin/pr27311b.c,
+ * testsuite/ld-plugin/pr27311c.c: New testcase.
+ * testsuite/ld-plugin/lto.exp: Run it. Correct PR14918 and
+ PR12982 entries.
+
2021-01-28 Alan Modra <amodra@gmail.com>
PR 27259
] \
[list \
"Build libpr16467b.so" \
- "-shared tmpdir/pr16467b.o tmpdir/libpr16467a.so \
+ "-shared -Wl,--as-needed tmpdir/pr16467b.o tmpdir/libpr16467a.so \
-Wl,--version-script=pr16467b.map" \
"-fPIC" \
{ dummy.c } \
] \
[list \
"Build libpr16467bn.so" \
- "-shared tmpdir/pr16467b.o tmpdir/libpr16467an.so \
+ "-shared -Wl,--as-needed tmpdir/pr16467b.o tmpdir/libpr16467an.so \
-Wl,--version-script=pr16467b.map" \
"-fPIC" \
{ dummy.c } \
[list {pr26806.so} \
{-shared} {-fpic -O2 -flto} \
{pr26806.c} {{nm {-D} pr26806.d}} {pr26806.so}] \
+ [list {pr27311a.so} \
+ {-shared -Wl,--version-script=pr27311.ver} {-fPIC} \
+ {pr27311a.c} {} {pr27311a.so}] \
+ [list {pr27311b.so} \
+ {-shared -Wl,--no-as-needed tmpdir/pr27311a.so} {-fPIC} \
+ {pr27311b.c} {} {pr27311b.so}] \
+ [list {pr27311c.o} \
+ {} {-flto} \
+ {pr27311c.c} {} {} {c}] \
+ [list {pr27311} \
+ {tmpdir/pr27311c.o -Wl,--no-as-needed,--rpath-link=. tmpdir/pr27311b.so} {} \
+ {dummy.c} {{readelf {--dyn-syms --wide} pr27311.d}} {pr27311}] \
]
# PR 14918 checks that libgcc is not spuriously included in a shared link of
# __aeabi_unwind_cpp_pr0@@GCC_3.5 which is provided by libgcc_s.so.1, so the
# test fails. Hence this code to skip the test.
if { ! [istarget "arm*-*-*"] } {
- lappend lto_link_elf_tests [list \
+ lappend lto_link_elf_tests \
[list "PR ld/14918" \
"-flto" "-flto" \
- {pr14918.c} {{"readelf" {-d --wide} "pr14918.d"}} "pr14918.exe" "c"] \
- ]
+ {pr14918.c} {{"readelf" {-d --wide} "pr14918.d"}} "pr14918.exe" "c"]
}
# PR 12982 checks that an executable stack is not created by default
# executable stack for syscall restarts and signal returns, so we
# skip this test for that target.
if { ! [istarget "hppa*-*-*"] } {
- lappend lto_link_elf_tests [list \
+ lappend lto_link_elf_tests \
[list "PR ld/12982" \
"-O2 -flto -fuse-linker-plugin" "-O2 -flto" \
- {pr12982.c} {{"readelf" {-l --wide} "pr12982.d"}} "pr12982.exe"] \
- ]
+ {pr12982.c} {{"readelf" {-l --wide} "pr12982.d"}} "pr12982.exe"]
}
# Check final symbols in executables.