https://sourceware.org/bugzilla/show_bug.cgi?id=19579

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|s390x-linux-gnu             |

--- Comment #8 from H.J. Lu <hjl.tools at gmail dot com> ---
[hjl@gnu-6 pr19579]$ cat x.c
int foo[10];

extern void bar (void);

int
main ()
{
  bar ();
  return foo[0] != 0;
}
[hjl@gnu-6 pr19579]$ cat y.c
void
bar (void)
{
}
[hjl@gnu-6 pr19579]$ cat foo.c
int foo[20];;
[hjl@gnu-6 pr19579]$ make
gcc  -pie -fPIE -g   -c -o x.o x.c
gcc  -pie -fPIE -g   -c -o y.o y.c
gcc  -pie -fPIE -g -fPIC   -c -o foo.o foo.c
gcc  -pie -shared -o libfoo.so foo.o
gcc  -pie -o x x.o y.o libfoo.so -Wl,-R.
/usr/local/bin/ld: x.o: relocation R_X86_64_PC32 against undefined symbol `foo'
can not be used when making a shared object; recompile with -fPIC
/usr/local/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
Makefile:15: 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

Reply via email to