forked from Imagelibrary/binutils-gdb
Linker checks if a symbol in an archive member is a real definition, not common, before including the archive member in the link output so that only a real definition in archive will override the common symbol in object file. Add an LTO test to verify that a real definition in archive overrides the common symbol in object file. * testsuite/ld-plugin/common-1.c: New file. * testsuite/ld-plugin/definition-1.c: Likewise. * testsuite/ld-plugin/lto.exp: Run common tests. Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
12 lines
97 B
C
12 lines
97 B
C
#include <stdio.h>
|
|
|
|
int foo;
|
|
|
|
int main()
|
|
{
|
|
if (foo == 1)
|
|
printf ("PASS\n");
|
|
|
|
return 0;
|
|
}
|