+2021-02-26 Alan Modra <amodra@gmail.com>
+
+ PR 27441
+ * testsuite/ld-plugin/pr27441a.c,
+ * testsuite/ld-plugin/pr27441b.c,
+ * testsuite/ld-plugin/pr27441c.c,
+ * testsuite/ld-plugin/pr27441c.d: New test.
+ * testsuite/ld-plugin/lto.exp: Run it.
+
2021-02-25 Jan Beulich <jbeulich@suse.com>
* ld.texi (PROVIDE): Downgrade "error" to "diagnostic".
[list {pr27311-2} \
{tmpdir/pr27311d.o -Wl,--no-as-needed,--rpath-link=. tmpdir/pr27311b.so} {} \
{dummy.c} {{readelf {--dyn-syms --wide} pr27311.d}} {pr27311-2}] \
+ [list {pr27441a.so} \
+ {-shared} {-fPIC} \
+ {pr27441a.c} {} {pr27441a.so}] \
+ [list {pr27441b.so} \
+ {-shared} {-fPIC} \
+ {pr27441b.c} {} {pr27441b.so}] \
+ [list {pr27441c.o} \
+ {} {-fPIC -flto} \
+ {pr27441c.c} {} {}] \
+ [list {pr27441c.so} \
+ {-shared -fPIC -Wl,--as-needed tmpdir/pr27441c.o tmpdir/pr27441b.so tmpdir/pr27441a.so} {-fPIC} \
+ {dummy.c} {{readelf {-dW} pr27441c.d}} {pr27441c.so}] \
]
# PR 14918 checks that libgcc is not spuriously included in a shared link of
--- /dev/null
+int func1 (void) { return 1; }
+int func2 (void) { return 2; }
--- /dev/null
+int __attribute__((weak)) func1 (void) { return 3; }
--- /dev/null
+extern int func1 (void);
+extern int func2 (void);
+
+int
+callthem (void)
+{
+ return func1 () + func2 ();
+}
--- /dev/null
+#...
+ .* \(NEEDED\) +Shared library: \[tmpdir/pr27441b.so\]
+ .* \(NEEDED\) +Shared library: \[tmpdir/pr27441a.so\]
+#pass