diff options
author | George Rimar <grimar@accesssoftek.com> | 2016-03-22 12:15:26 +0000 |
---|---|---|
committer | George Rimar <grimar@accesssoftek.com> | 2016-03-22 12:15:26 +0000 |
commit | 9f8f4e39445700fc8855b68c499ca64b87b427db (patch) | |
tree | 777a3f660ae164a628d9408a0871fcfd3cf550d1 | |
parent | 33ef7dad18c9fc3d5cc3c9ee3f3528e825f10e24 (diff) | |
download | bcm5719-llvm-9f8f4e39445700fc8855b68c499ca64b87b427db.tar.gz bcm5719-llvm-9f8f4e39445700fc8855b68c499ca64b87b427db.zip |
[ELF] - Process R_X86_64_GOTPCRELX/R_X86_64_REX_GOTPCRELX relocations.
R_X86_64_GOTPCRELX and R_X86_64_REX_GOTPCRELX relocations were added in latest ABI:
https://github.com/hjl-tools/x86-psABI/wiki/x86-64-psABI-r249.pdf
They should be generated instead of R_X86_64_GOTPCREL for cases
when relaxation is possible. Currently this patch just process them in the
same way like R_X86_64_GOTPCREL. That should work for now
and we can implement relaxations later.
There is no testcases provided as I think there is no way to generate
such relocations using llvm-mc atm.
Differential revision: http://reviews.llvm.org/D18301
llvm-svn: 264043
-rw-r--r-- | lld/ELF/Target.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lld/ELF/Target.cpp b/lld/ELF/Target.cpp index fda8975c95f..65fb0324e3c 100644 --- a/lld/ELF/Target.cpp +++ b/lld/ELF/Target.cpp @@ -736,7 +736,8 @@ bool X86_64TargetInfo::needsCopyRelImpl(uint32_t Type) const { } bool X86_64TargetInfo::refersToGotEntry(uint32_t Type) const { - return Type == R_X86_64_GOTPCREL; + return Type == R_X86_64_GOTPCREL || Type == R_X86_64_GOTPCRELX || + Type == R_X86_64_REX_GOTPCRELX; } bool X86_64TargetInfo::needsGot(uint32_t Type, SymbolBody &S) const { @@ -934,6 +935,8 @@ void X86_64TargetInfo::relocateOne(uint8_t *Loc, uint8_t *BufEnd, uint32_t Type, write32le(Loc, SA); break; case R_X86_64_GOTPCREL: + case R_X86_64_GOTPCRELX: + case R_X86_64_REX_GOTPCRELX: case R_X86_64_PC32: case R_X86_64_PLT32: case R_X86_64_TLSGD: |