Browse Source
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.binutils-2_39-branch
5 changed files with 36 additions and 2 deletions
@ -0,0 +1,19 @@ |
|||
int |
|||
foo (void) |
|||
{ |
|||
return 0; |
|||
} |
|||
|
|||
int |
|||
main () |
|||
{ |
|||
return foo (); |
|||
} |
|||
|
|||
extern int __real_foo (void); |
|||
|
|||
int |
|||
__wrap_foo (void) |
|||
{ |
|||
return __real_foo (); |
|||
} |
|||
Loading…
Reference in new issue