aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2022-04-25 10:51:39 -0700
committerH.J. Lu <hjl.tools@gmail.com>2022-05-04 16:26:51 -0700
commitda422fa49d508e33b8f1b2bd9b8f719b831b199b (patch)
tree197586145f0c372bad5abda8d2032fd9eaf6db63 /include
parent40ae4abe44fa4e0a53d1681bc48adf445df25822 (diff)
downloadgdb-da422fa49d508e33b8f1b2bd9b8f719b831b199b.zip
gdb-da422fa49d508e33b8f1b2bd9b8f719b831b199b.tar.gz
gdb-da422fa49d508e33b8f1b2bd9b8f719b831b199b.tar.bz2
LTO: Handle __real_SYM reference in IR
When an IR symbol SYM is referenced in IR via __real_SYM, its resolution should be LDPR_PREVAILING_DEF, not PREVAILING_DEF_IRONLY, since LTO doesn't know that __real_SYM should be resolved by SYM. bfd/ PR ld/29086 * linker.c (bfd_wrapped_link_hash_lookup): Mark SYM is referenced via __real_SYM. include/ PR ld/29086 * bfdlink.h (bfd_link_hash_entry): Add ref_real. ld/ PR ld/29086 * plugin.c (get_symbols): Resolve SYM definition to LDPR_PREVAILING_DEF for __real_SYM reference. * testsuite/ld-plugin/lto.exp: Run PR ld/29086 test. * testsuite/ld-plugin/pr29086.c: New file.
Diffstat (limited to 'include')
-rw-r--r--include/bfdlink.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/bfdlink.h b/include/bfdlink.h
index 88cc8e2..27a8e11 100644
--- a/include/bfdlink.h
+++ b/include/bfdlink.h
@@ -114,6 +114,9 @@ struct bfd_link_hash_entry
as distinct from a LTO IR object file. */
unsigned int non_ir_ref_dynamic : 1;
+ /* The symbol, SYM, is referenced by __real_SYM in an object file. */
+ unsigned int ref_real : 1;
+
/* Symbol is a built-in define. These will be overridden by PROVIDE
in a linker script. */
unsigned int linker_def : 1;