diff options
Diffstat (limited to 'ELF/Arch/PPC64.cpp')
-rw-r--r-- | ELF/Arch/PPC64.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/ELF/Arch/PPC64.cpp b/ELF/Arch/PPC64.cpp index bf414d75bec7..ac4021b5918d 100644 --- a/ELF/Arch/PPC64.cpp +++ b/ELF/Arch/PPC64.cpp @@ -7,10 +7,10 @@ // //===----------------------------------------------------------------------===// -#include "Error.h" #include "Symbols.h" #include "SyntheticSections.h" #include "Target.h" +#include "lld/Common/ErrorHandler.h" #include "llvm/Support/Endian.h" using namespace llvm; @@ -39,11 +39,11 @@ namespace { class PPC64 final : public TargetInfo { public: PPC64(); - RelExpr getRelExpr(uint32_t Type, const SymbolBody &S, + RelExpr getRelExpr(RelType Type, const Symbol &S, const uint8_t *Loc) const override; void writePlt(uint8_t *Buf, uint64_t GotPltEntryAddr, uint64_t PltEntryAddr, int32_t Index, unsigned RelOff) const override; - void relocateOne(uint8_t *Loc, uint32_t Type, uint64_t Val) const override; + void relocateOne(uint8_t *Loc, RelType Type, uint64_t Val) const override; }; } // namespace @@ -82,11 +82,9 @@ PPC64::PPC64() { DefaultImageBase = 0x10000000; } -RelExpr PPC64::getRelExpr(uint32_t Type, const SymbolBody &S, +RelExpr PPC64::getRelExpr(RelType Type, const Symbol &S, const uint8_t *Loc) const { switch (Type) { - default: - return R_ABS; case R_PPC64_TOC16: case R_PPC64_TOC16_DS: case R_PPC64_TOC16_HA: @@ -98,6 +96,8 @@ RelExpr PPC64::getRelExpr(uint32_t Type, const SymbolBody &S, return R_PPC_TOC; case R_PPC64_REL24: return R_PPC_PLT_OPD; + default: + return R_ABS; } } @@ -122,7 +122,7 @@ void PPC64::writePlt(uint8_t *Buf, uint64_t GotPltEntryAddr, write32be(Buf + 28, 0x4e800420); // bctr } -static std::pair<uint32_t, uint64_t> toAddr16Rel(uint32_t Type, uint64_t Val) { +static std::pair<RelType, uint64_t> toAddr16Rel(RelType Type, uint64_t Val) { uint64_t V = Val - PPC64TocOffset; switch (Type) { case R_PPC64_TOC16: @@ -142,7 +142,7 @@ static std::pair<uint32_t, uint64_t> toAddr16Rel(uint32_t Type, uint64_t Val) { } } -void PPC64::relocateOne(uint8_t *Loc, uint32_t Type, uint64_t Val) const { +void PPC64::relocateOne(uint8_t *Loc, RelType Type, uint64_t Val) const { // For a TOC-relative relocation, proceed in terms of the corresponding // ADDR16 relocation type. std::tie(Type, Val) = toAddr16Rel(Type, Val); |