https://sourceware.org/bugzilla/show_bug.cgi?id=19579
--- Comment #10 from H.J. Lu <hjl.tools at gmail dot com> --- (In reply to H.J. Lu from comment #9) > Created attachment 9059 [details] > A patch > > Please try this patch. Doesn't work: [hjl@gnu-6 pr19579]$ cat x.c #include <stdio.h> int foo[1]; int bar[1]; 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; } [hjl@gnu-6 pr19579]$ cat foo.c int foo[2]; int bar[2] = { -1, -1 }; int * foo_p (void) { return foo; } int * bar_p (void) { return bar; } [hjl@gnu-6 pr19579]$ make gcc -pie -fPIE -O0 -c -o x.o x.c gcc -pie -fPIE -O0 -fPIC -c -o foo.o foo.c gcc -pie -shared -o libfoo.so foo.o gcc -pie -o x x.o libfoo.so -Wl,-R. /usr/local/bin/ld: Warning: size of symbol `bar' changed from 4 in x.o to 8 in libfoo.so /usr/local/bin/ld: x.o(.text+0x24): unresolvable R_X86_64_PC32 relocation against symbol `bar' /usr/local/bin/ld: final link failed: Nonrepresentable section on output collect2: error: ld returned 1 exit status Makefile:17: recipe for target 'x' failed make: *** [x] Error 1 [hjl@gnu-6 pr19579]$ -- You are receiving this mail because: You are on the CC list for the bug. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils