61315175ad
bfd/ PR ld/15323 * elf32-i386.c (elf_i386_check_relocs): Set non_ir_ref if a symbol is referenced by a non-shared object. * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise. ld/testsuite/ PR ld/15323 * ld-plugin/lto.exp (lto_link_tests): Add pr15323a-r.o. (lto_run_tests): Add a test for PR ld/15323. * ld-plugin/pr15323.out: New file. * ld-plugin/pr15323a.c: Likewise. * ld-plugin/pr15323b.c: Likewise.
14 lines
160 B
C
14 lines
160 B
C
#include <stdio.h>
|
|
|
|
int x;
|
|
|
|
__attribute__((weak))
|
|
void foobar (void) { x++; }
|
|
|
|
int main (void)
|
|
{
|
|
foobar ();
|
|
if (x == -1)
|
|
printf ("OK\n");
|
|
return 0;
|
|
}
|