]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
ld: Properly override the IR definition
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 22 Jul 2020 10:49:07 +0000 (03:49 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 22 Jul 2020 12:47:43 +0000 (05:47 -0700)
commit041d1c2d4f03a134cb7574e4d62d2ce4418503ff
tree2867e8abdfea4df1bda038aed110c3c9bffdc50f
parent544fb8890237fc623c6c08ec0f8e50c129a78c91
ld: Properly override the IR definition

We change the previous definition in the IR object to undefweak only
after all LTO symbols have been read.

include/

PR ld/26262
PR ld/26267
* bfdlink.h (bfd_link_info): Add lto_all_symbols_read.

ld/

PR ld/26262
PR ld/26267
* ldlang.c (lang_process): Set lto_all_symbols_read after all
LTO IR symbols have been read.
* plugin.c (plugin_notice): Override the IR definition only if
all LTO IR symbols have been read or the new definition is
non-weak and the the IR definition is weak
* testsuite/ld-plugin/lto.exp: Run PR ld/26262 and ld/26267
tests.
* testsuite/ld-plugin/pr26262a.c: New file.
* testsuite/ld-plugin/pr26262b.c: Likewise.
* testsuite/ld-plugin/pr26262c.c: Likewise.
* testsuite/ld-plugin/pr26267.err: Likewise.
* testsuite/ld-plugin/pr26267a.c: Likewise.
* testsuite/ld-plugin/pr26267b.c: Likewise.
* testsuite/ld-plugin/pr26267c.c: Likewise.

(cherry picked from commit 0e6a3f07f50723d1831291492b96fdf74bcbdc11)
13 files changed:
include/ChangeLog
include/bfdlink.h
ld/ChangeLog
ld/ldlang.c
ld/plugin.c
ld/testsuite/ld-plugin/lto.exp
ld/testsuite/ld-plugin/pr26262a.c [new file with mode: 0644]
ld/testsuite/ld-plugin/pr26262b.c [new file with mode: 0644]
ld/testsuite/ld-plugin/pr26262c.c [new file with mode: 0644]
ld/testsuite/ld-plugin/pr26267.err [new file with mode: 0644]
ld/testsuite/ld-plugin/pr26267a.c [new file with mode: 0644]
ld/testsuite/ld-plugin/pr26267b.c [new file with mode: 0644]
ld/testsuite/ld-plugin/pr26267c.c [new file with mode: 0644]