[Bug target/49950] New: GOT relocation for -fPIE is excessive
jan.kratochvil at redhat dot com
gcc-bugzilla@gcc.gnu.org
Tue Aug 2 19:44:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49950
Summary: GOT relocation for -fPIE is excessive
Product: gcc
Version: 4.4.7
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: target
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: jan.kratochvil@redhat.com
Target: x86_64-unknown-linux-gnu
FAIL: gcc (GCC) 4.4.7 20110802 (prerelease)
FAIL: gcc (GCC) 4.5.4 20110802 (prerelease)
FAIL: gcc (GCC) 4.6.2 20110802 (prerelease)
FAIL: gcc (GCC) 4.7.0 20110802 (experimental)
echo 'int i; int f (void) { return i; }' | gcc -c -o 20.o -Wall -fPIE -x c -
readelf -Wr 20.o
0000000000000007 0000000800000009 R_X86_64_GOTPCREL 0000000000000004 i -
4
none: R_X86_64_PC32 is correct
-fPIE: R_X86_64_GOTPCREL is excessive - this Bug
-fPIC: R_X86_64_GOTPCREL is correct
Jakub:
the difference between -fPIE and -fPIC is that the former assumes that you
can't override its symbols
so if it sees some symbol defined in the current source file, it knows that it
will be the definition at runtime
for -shared libraries that is not true, other shared libraries defining the
same symbol can override it, so they need more runtime relocations
More information about the Gcc-bugs
mailing list