mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2025-01-12 12:16:04 +08:00
da422fa49d
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.
20 lines
147 B
C
20 lines
147 B
C
int
|
|
foo (void)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
int
|
|
main ()
|
|
{
|
|
return foo ();
|
|
}
|
|
|
|
extern int __real_foo (void);
|
|
|
|
int
|
|
__wrap_foo (void)
|
|
{
|
|
return __real_foo ();
|
|
}
|