summaryrefslogtreecommitdiffstats
path: root/lld/ELF/LinkerScript.cpp
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2017-04-05 16:01:33 +0000
committerRui Ueyama <ruiu@google.com>2017-04-05 16:01:33 +0000
commit9c766d7a397b652b5a04c6acff16b1473a3c8838 (patch)
treeeb343629064f782053d9dcc5eaf5057e28fe721b /lld/ELF/LinkerScript.cpp
parentaa65a2beb875e2bbe2c1b71ea3bf648d35101469 (diff)
downloadbcm5719-llvm-9c766d7a397b652b5a04c6acff16b1473a3c8838.tar.gz
bcm5719-llvm-9c766d7a397b652b5a04c6acff16b1473a3c8838.zip
Fix PLT and GOTPLT entries for 32-bit x86 PIC.
Previously, the code we set to our .plt entries expected that .got and .got.plt are consecutive in the virtual address space. Since %ebx points to the last entry of .got for position-independent code, it assumed that .got is accessible with small negative displacements and .got.plt are accessible with small positive displacements. That assumption was simply wrong. We don't impose any restrictions on relative layout of .got and .got.plt. As a result, the control is transferred to a bogus address from .plt at runtime, which resulted in segfaults. This patch removes that wrong assumption. We still assume that .got.plt has a fixed relative address to .got, but we no longer assume that they are consecutive in memory. With this change, a "hello world" program compiled with -fPIC works. Fixes https://bugs.llvm.org/show_bug.cgi?id=31332. Differential Revision: https://reviews.llvm.org/D31682 llvm-svn: 299553
Diffstat (limited to 'lld/ELF/LinkerScript.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud