PR26806, Suspected linker bug with LTO
authorAlan Modra <amodra@gmail.com>
Fri, 30 Oct 2020 04:26:35 +0000 (14:56 +1030)
committerAlan Modra <amodra@gmail.com>
Sun, 1 Nov 2020 23:09:53 +0000 (09:39 +1030)
commitb1a92c635c1ec10fd703302ce1fc4ab3a8515a04
tree80c9f60d71a1d360f6a223b8d3ee4c330a5af55d
parentae7754b256f1f230baec364d90561c3ca34f7e64
PR26806, Suspected linker bug with LTO

This patch reverts most of git commit 1e3b96fd6cf, so IR symbols are
again not marked def_regular or ref_regular.  That should be enough to
stop IR symbols from becoming dynamic.  To mark as-needed shared
libraries referenced by IR symbols, use the referencing BFD rather
than the ref flags.

bfd/
PR 15146
PR 26314
PR 26530
PR 26806
* elflink.c (elf_link_add_object_symbols): Don't set def/ref flags
for plugin syms.  Do allow plugin syms to mark as-needed libs.
ld/
PR 26806
* testsuite/ld-plugin/lto-19.h,
* testsuite/ld-plugin/lto-19a.c,
* testsuite/ld-plugin/lto-19b.c,
* testsuite/ld-plugin/lto-19c.c: New test.
* testsuite/ld-plugin/pr26806.c,
* testsuite/ld-plugin/pr26806.d: New test.
* testsuite/ld-plugin/lto.exp: Run them.
bfd/ChangeLog
bfd/elflink.c
ld/ChangeLog
ld/testsuite/ld-plugin/lto-19.h [new file with mode: 0644]
ld/testsuite/ld-plugin/lto-19a.c [new file with mode: 0644]
ld/testsuite/ld-plugin/lto-19b.c [new file with mode: 0644]
ld/testsuite/ld-plugin/lto-19c.c [new file with mode: 0644]
ld/testsuite/ld-plugin/lto.exp
ld/testsuite/ld-plugin/pr26806.c [new file with mode: 0644]
ld/testsuite/ld-plugin/pr26806.d [new file with mode: 0644]