Mark the plugin symbol undefined
authorH.J. Lu <hjl.tools@gmail.com>
Tue, 3 Feb 2015 17:03:23 +0000 (09:03 -0800)
committerH.J. Lu <hjl.tools@gmail.com>
Tue, 3 Feb 2015 17:03:23 +0000 (09:03 -0800)
commit60f79275127603876d94da4bf4e3f6212903b407
tree7aef6f3ba041e6588c0c354e7491bafff6ba7da8
parent9910b1c8f3b0821944303fbcb4ef4c8872cf4e08
Mark the plugin symbol undefined

LTO may optimize out a plugin symbol, which is also referenced by a
non-IR file.  When that happens, we should mark the plugin symbol
undefined.  It isn't the problem since LTO already determined the
symbols in the non-IR file aren't used.

bfd/

PR ld/12365
PR ld/14272
* elflink.c (_bfd_elf_fix_symbol_flags): Mark the plugin symbol
undefined if it is referenced from a non-IR file.

ld/testsuite/

PR ld/12365
* ld-plugin/pr12365a.c: New file.
* ld-plugin/pr12365b.c: Likewise.
* ld-plugin/pr12365c.c: Likewise.

* ld-plugin/lto.exp (lto_link_tests): Prepare for the PR ld/12365
test.
Run the PR ld/12365 test.
bfd/ChangeLog
bfd/elflink.c
ld/testsuite/ChangeLog
ld/testsuite/ld-plugin/lto.exp
ld/testsuite/ld-plugin/pr12365a.c [new file with mode: 0644]
ld/testsuite/ld-plugin/pr12365b.c [new file with mode: 0644]
ld/testsuite/ld-plugin/pr12365c.c [new file with mode: 0644]