bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/19579] [Regression] link error linking fortran code on s390x-lin


From: hjl.tools at gmail dot com
Subject: [Bug ld/19579] [Regression] link error linking fortran code on s390x-linux-gnu
Date: Wed, 02 Mar 2016 21:05:46 +0000

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:

address@hidden 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;
}
address@hidden pr19579]$ cat foo.c
int foo[2];
int bar[2] = { -1, -1 };

int *
foo_p (void)
{
  return foo;
}

int *
bar_p (void)
{
  return bar;
}
address@hidden 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
address@hidden pr19579]$

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]