+2017-09-28 Alan Modra <amodra@gmail.com>
+
+ PR 22220
+ * elflink.c (_bfd_elf_merge_symbol): Set non_ir_ref_dynamic in
+ a case where plugin_notice isn't called.
+
2017-09-27 Kuan-Lin Chen <kuanlinchentw@gmail.com>
* elf32-nds32.c (nds32_elf_relax_section): Fix a tautological
olddyn = (oldsec->symbol->flags & BSF_DYNAMIC) != 0;
}
+ /* Handle a case where plugin_notice won't be called and thus won't
+ set the non_ir_ref flags on the first pass over symbols. */
+ if (oldbfd != NULL
+ && (oldbfd->flags & BFD_PLUGIN) != (abfd->flags & BFD_PLUGIN)
+ && newdyn != olddyn)
+ {
+ h->root.non_ir_ref_dynamic = TRUE;
+ hi->root.non_ir_ref_dynamic = TRUE;
+ }
+
/* NEWDEF and OLDDEF indicate whether the new or old symbol,
respectively, appear to be a definition rather than reference. */
+2017-09-28 Alan Modra <amodra@gmail.com>
+
+ * testsuite/ld-plugin/pr22220.h,
+ * testsuite/ld-plugin/pr22220lib.cc,
+ * testsuite/ld-plugin/pr22220lib.ver,
+ * testsuite/ld-plugin/pr22220main.cc: New test.
+ * testsuite/ld-plugin/lto.exp: Run it.
+
2017-09-26 Maciej W. Rozycki <macro@imgtec.com>
* testsuite/ld-undefined/undefined.exp: Correct the dyn reloc
[list "Build pr21382.so" \
"-shared" "-O2 -fpic" \
{pr21382b.c} {} "pr21382.so" "c"] \
+ [list {Build pr22220lib.so} \
+ {-shared -Wl,--version-script=pr22220lib.ver} {-fPIC} \
+ {pr22220lib.cc} {} {pr22220lib.so} {c++}] \
+ [list {Build pr22220main.o} \
+ {} {-flto} \
+ {pr22220main.cc} {} {} {c++}] \
]
# Check final symbols in executables.
[list "Run pr21382" \
"-O2 -flto -fuse-linker-plugin -Wl,--as-needed tmpdir/pr21382a.o tmpdir/pr21382.so" "" \
{dummy.c} "pr21382.exe" "pass.out" "" "c"] \
+ [list {pr22220a} \
+ {-flto -fuse-linker-plugin tmpdir/pr22220main.o tmpdir/pr22220lib.so} {} \
+ {dummy.c} {pr22220a.exe} {pass.out} {} {c++}] \
+ [list {pr22220b} \
+ {-flto -fuse-linker-plugin -Wl,--no-as-needed tmpdir/pr22220lib.so tmpdir/pr22220main.o} {} \
+ {dummy.c} {pr22220b.exe} {pass.out} {} {c++}] \
]
# LTO run-time tests for ELF
--- /dev/null
+extern int doo();
+
+inline int *goo() {
+ static int xyz;
+ return &xyz;
+}
+
+int *boo();
--- /dev/null
+#include "pr22220.h"
+
+int* boo()
+{
+ return goo ();
+}
--- /dev/null
+BAR { global: *; };
--- /dev/null
+#include <stdio.h>
+#include "pr22220.h"
+
+int main()
+{
+ if (boo() == goo())
+ {
+ printf ("PASS\n");
+ return 0;
+ }
+ return 1;
+}