diff options
author | Simon Atanasyan <simon@atanasyan.com> | 2016-11-23 22:22:16 +0000 |
---|---|---|
committer | Simon Atanasyan <simon@atanasyan.com> | 2016-11-23 22:22:16 +0000 |
commit | 8469b8841c4bbb8276cfb6b172a18d9dea8b093a (patch) | |
tree | 291a2369c40aec1c9c538aba17144ce3333e29c0 /llvm/lib/DebugInfo/PDB/Raw/ModStream.cpp | |
parent | 934470f5362a94ba92a1ac1a6c298c8a04e96ac4 (diff) | |
download | llvm-8469b8841c4bbb8276cfb6b172a18d9dea8b093a.zip llvm-8469b8841c4bbb8276cfb6b172a18d9dea8b093a.tar.gz llvm-8469b8841c4bbb8276cfb6b172a18d9dea8b093a.tar.bz2 |
[ELF][MIPS] Fix handling of _gp/_gp_disp/__gnu_local_gp symbols
Offset between beginning of a .got section and _gp symbols used in MIPS
GOT relocations calculations. Usually the expression looks like
VA + Offset - GP, where VA is the .got section address, Offset - offset
of the GOT entry, GP - offset between .got and _gp. Also there two "magic"
symbols _gp_disp and __gnu_local_gp which hold the offset mentioned above.
These symbols might be referenced by MIPS relocations.
Now the linker always defines _gp symbol and uses hardcoded value for
its initialization. So offset between .got and _gp is 0x7ff0. The _gp_disp
and __gnu_local_gp defined if required and initialized by 0x7ff0.
In fact that is not correct because _gp symbol might be defined by a linker
script and holds arbitrary value. In that case we need to use this value
in relocation calculation and initialize _gp_disp and __gnu_local_gp
properly.
The patch fixes the problem and completes fixing the bug #30311.
https://llvm.org/bugs/show_bug.cgi?id=30311
Differential revision: https://reviews.llvm.org/D27036
llvm-svn: 287832
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/Raw/ModStream.cpp')
0 files changed, 0 insertions, 0 deletions