Bug 14324 - internal error in relocate, at ../../gold/x86_64.cc:3361 with gcc -mcmodel=large
Summary: internal error in relocate, at ../../gold/x86_64.cc:3361 with gcc -mcmodel=large
Status: RESOLVED DUPLICATE of bug 16870
Alias: None
Product: binutils
Classification: Unclassified
Component: gold (show other bugs)
Version: 2.24
: P2 normal
Target Milestone: ---
Assignee: Ian Lance Taylor
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-02 20:11 UTC by bernhard.rosenkranzer@linaro.org
Modified: 2014-05-14 16:51 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description bernhard.rosenkranzer@linaro.org 2012-07-02 20:11:35 UTC
If gold is the default linker, samba 4.0.0-beta2's configure script fails while checking the compiler.

It comes down to samba 4.x's usage of the -mcmodel=large compiler flag in combination with -fPIC.

[bero@localhost ~]$ cat test.c
int puts(const char *s);
int main(int argc, char **argv) {
        puts("test");
}
[bero@localhost ~]$ gcc -mcmodel=large -fPIC test.c
/usr/bin/ld: internal error in relocate, at ../../gold/x86_64.cc:3361
collect2: error: ld returned 1 exit status

The same code w/ the same options links fine with bfd ld.

Seen on the gold included in hjl's binutils 2.22.52.0.4 release (20120604).
Comment 1 Alexander Ivchenko 2014-05-14 14:27:46 UTC
Also faced the same problem with Android NDK (gold and fpic are defaults there):

[...]gold/testsuite/gcctestdir/ld: internal error in relocate, at ../../binutils-gdb/gold/x86_64.cc:3397
Comment 2 H.J. Lu 2014-05-14 16:51:53 UTC
It is a dup.

*** This bug has been marked as a duplicate of bug 16870 ***