mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-27 04:52:05 +08:00
60f7927512
LTO may optimize out a plugin symbol, which is also referenced by a non-IR file. When that happens, we should mark the plugin symbol undefined. It isn't the problem since LTO already determined the symbols in the non-IR file aren't used. bfd/ PR ld/12365 PR ld/14272 * elflink.c (_bfd_elf_fix_symbol_flags): Mark the plugin symbol undefined if it is referenced from a non-IR file. ld/testsuite/ PR ld/12365 * ld-plugin/pr12365a.c: New file. * ld-plugin/pr12365b.c: Likewise. * ld-plugin/pr12365c.c: Likewise. * ld-plugin/lto.exp (lto_link_tests): Prepare for the PR ld/12365 test. Run the PR ld/12365 test.
26 lines
424 B
C
26 lines
424 B
C
extern void abort(void);
|
|
extern void main_test (void);
|
|
extern void abort (void);
|
|
int inside_main;
|
|
|
|
int
|
|
main ()
|
|
{
|
|
inside_main = 1;
|
|
main_test ();
|
|
inside_main = 0;
|
|
return 0;
|
|
}
|
|
|
|
/* When optimizing, all the constant cases should have been
|
|
constant folded, so no calls to link_error should remain.
|
|
In any case, link_error should not be called. */
|
|
|
|
#ifndef __OPTIMIZE__
|
|
void
|
|
link_error (void)
|
|
{
|
|
abort ();
|
|
}
|
|
#endif
|