Browse Source
When undefined non-weak references in IR objects are optimized out by LTO, we can have weak dynamic referencs to symbols marked with bfd_link_hash_undefined. We shouldn't complain such undefined weak dynamic references. bfd/ PR ld/24486 * elflink.c (elf_link_output_extsym): Don't complain undefined weak dynamic reference. ld/ PR ld/24486 * testsuite/ld-plugin/lto.exp: Run PR ld/24486 tests. * testsuite/ld-plugin/pr24486a.c: New file. * testsuite/ld-plugin/pr24486b.c: Likewise. * testsuite/ld-plugin/pr24486c.c: Likewise.binutils-2_33-branch
7 changed files with 44 additions and 1 deletions
@ -0,0 +1,8 @@ |
|||
extern int FLAGS_verbose; |
|||
extern void bar (void); |
|||
int |
|||
a(void) { |
|||
return FLAGS_verbose; |
|||
} |
|||
void unused (void) { bar(); } |
|||
int main() { return a (); } |
|||
@ -0,0 +1,8 @@ |
|||
extern void bar (void) __attribute__((weak)); |
|||
|
|||
void |
|||
foo (void) |
|||
{ |
|||
if (bar) |
|||
bar (); |
|||
} |
|||
@ -0,0 +1 @@ |
|||
int FLAGS_verbose; |
|||
Loading…
Reference in new issue