summaryrefslogtreecommitdiffstats
path: root/lld/ELF/InputSection.cpp
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2019-06-03 06:21:33 +0000
committerFangrui Song <maskray@google.com>2019-06-03 06:21:33 +0000
commit8522d579b894b8e43ed0bfee5d3c9c2238805234 (patch)
treec8444e47c9f8c4e0665930ef4ad69dd85a873a41 /lld/ELF/InputSection.cpp
parentea0c66be55114087d2151401756612b49f3589eb (diff)
downloadbcm5719-llvm-8522d579b894b8e43ed0bfee5d3c9c2238805234.tar.gz
bcm5719-llvm-8522d579b894b8e43ed0bfee5d3c9c2238805234.zip
[ELF][PPC64] Rename some PPC64 ELFv2 specific RelExpr from R_PPC_* to R_PPC64_*
The following abstract relocation types (RelExpr) are PPC64 ELFv2 ABI specific, not used by PPC32. So rename them to prevent confusion when the PPC32 port is improved. * R_PPC_CALL R_PPC_CALL_PLT: R_PPC_CALL_PLT represents R_PPC64_REL14 and R_PPC64_REL24. If the function is not preemptable, R_PPC_CALL_PLT can be optimized to R_PPC_CALL: the formula adjusts the symbol VA from the global entry point to the local entry point. * R_PPC_TOC: represents R_PPC64_TOC. We don't have a test. Add one to ppc64-relocs.s Rename it to R_PPC64_TOCBASE because `@tocbase` is the assembly form. Reviewed By: ruiu Differential Revision: https://reviews.llvm.org/D62800 llvm-svn: 362359
Diffstat (limited to 'lld/ELF/InputSection.cpp')
-rw-r--r--lld/ELF/InputSection.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lld/ELF/InputSection.cpp b/lld/ELF/InputSection.cpp
index 45bafd321de..74a8028e229 100644
--- a/lld/ELF/InputSection.cpp
+++ b/lld/ELF/InputSection.cpp
@@ -717,9 +717,9 @@ static uint64_t getRelocTargetVA(const InputFile *File, RelType Type, int64_t A,
case R_PLT:
return Sym.getPltVA() + A;
case R_PLT_PC:
- case R_PPC_CALL_PLT:
+ case R_PPC64_CALL_PLT:
return Sym.getPltVA() + A - P;
- case R_PPC_CALL: {
+ case R_PPC64_CALL: {
uint64_t SymVA = Sym.getVA(A);
// If we have an undefined weak symbol, we might get here with a symbol
// address of zero. That could overflow, but the code must be unreachable,
@@ -735,7 +735,7 @@ static uint64_t getRelocTargetVA(const InputFile *File, RelType Type, int64_t A,
// branching to the local entry point.
return SymVA - P + getPPC64GlobalEntryToLocalEntryOffset(Sym.StOther);
}
- case R_PPC_TOC:
+ case R_PPC64_TOCBASE:
return getPPC64TocBase() + A;
case R_RELAX_GOT_PC:
return Sym.getVA(A) - P;
@@ -922,7 +922,7 @@ void InputSectionBase::relocateAlloc(uint8_t *Buf, uint8_t *BufEnd) {
case R_RELAX_TLS_GD_TO_IE_GOTPLT:
Target->relaxTlsGdToIe(BufLoc, Type, TargetVA);
break;
- case R_PPC_CALL:
+ case R_PPC64_CALL:
// If this is a call to __tls_get_addr, it may be part of a TLS
// sequence that has been relaxed and turned into a nop. In this
// case, we don't want to handle it as a call.
OpenPOWER on IntegriCloud