forked from OSchip/llvm-project
9c766d7a39
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 |
||
---|---|---|
.. | ||
COFF | ||
Driver/Inputs | ||
ELF | ||
Unit | ||
darwin | ||
mach-o | ||
CMakeLists.txt | ||
lit.cfg | ||
lit.site.cfg.in |