mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-27 04:52:05 +08:00
07492f668d
Common symbol in executable is a definition, which overrides definition from shared objects. When linker sees a new definition from a shared object, the new dynamic definition should be overridden by the previous common symbol in executable. bfd/ PR ld/19579 * elflink.c (_bfd_elf_merge_symbol): Treat common symbol in executable as definition if the new definition comes from a shared library. ld/ PR ld/19579 * testsuite/ld-elf/pr19579a.c: New file. * testsuite/ld-elf/pr19579b.c: Likewise. * testsuite/ld-elf/shared.exp: Run PR ld/19579 test.
16 lines
221 B
C
16 lines
221 B
C
#include <stdio.h>
|
|
|
|
int foo[1];
|
|
int bar[2];
|
|
|
|
extern int *foo_p (void);
|
|
extern int *bar_p (void);
|
|
|
|
int
|
|
main ()
|
|
{
|
|
if (foo[0] == 0 && foo == foo_p () && bar[0] == 0 && bar == bar_p ())
|
|
printf ("PASS\n");
|
|
return 0;
|
|
}
|