diff options
author | Nathan Sidwell <nathan@acm.org> | 2023-04-21 13:42:20 -0400 |
---|---|---|
committer | Nathan Sidwell <nathan@acm.org> | 2023-04-23 13:09:37 -0400 |
commit | 5b9f0309d653ce096c65e60d4073a076914fe11e (patch) | |
tree | 908300979087c95ac34cd67d04338cd9b90d4ee3 /bolt | |
parent | 15d28212632d550d437b8812c53a0e1f38aa4591 (diff) | |
download | llvm-5b9f0309d653ce096c65e60d4073a076914fe11e.tar.gz |
[BOLT] Remove unsupported ELF type reloc handling
Drop unsupported ELF format reloc handling -- RewriteInstance lacks
this flexibility elsewhere.
Reviewed By: rafauler
Differential Revision: https://reviews.llvm.org/D148946
Diffstat (limited to 'bolt')
-rw-r--r-- | bolt/lib/Rewrite/RewriteInstance.cpp | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/bolt/lib/Rewrite/RewriteInstance.cpp b/bolt/lib/Rewrite/RewriteInstance.cpp index 9a58968e5d20..b06c4a64ba52 100644 --- a/bolt/lib/Rewrite/RewriteInstance.cpp +++ b/bolt/lib/Rewrite/RewriteInstance.cpp @@ -1919,14 +1919,7 @@ int64_t getRelocationAddend(const ELFObjectFile<ELFT> *Obj, int64_t getRelocationAddend(const ELFObjectFileBase *Obj, const RelocationRef &Rel) { - if (auto *ELF32LE = dyn_cast<ELF32LEObjectFile>(Obj)) - return getRelocationAddend(ELF32LE, Rel); - if (auto *ELF64LE = dyn_cast<ELF64LEObjectFile>(Obj)) - return getRelocationAddend(ELF64LE, Rel); - if (auto *ELF32BE = dyn_cast<ELF32BEObjectFile>(Obj)) - return getRelocationAddend(ELF32BE, Rel); - auto *ELF64BE = cast<ELF64BEObjectFile>(Obj); - return getRelocationAddend(ELF64BE, Rel); + return getRelocationAddend(cast<ELF64LEObjectFile>(Obj), Rel); } template <typename ELFT> @@ -1953,14 +1946,7 @@ uint32_t getRelocationSymbol(const ELFObjectFile<ELFT> *Obj, uint32_t getRelocationSymbol(const ELFObjectFileBase *Obj, const RelocationRef &Rel) { - if (auto *ELF32LE = dyn_cast<ELF32LEObjectFile>(Obj)) - return getRelocationSymbol(ELF32LE, Rel); - if (auto *ELF64LE = dyn_cast<ELF64LEObjectFile>(Obj)) - return getRelocationSymbol(ELF64LE, Rel); - if (auto *ELF32BE = dyn_cast<ELF32BEObjectFile>(Obj)) - return getRelocationSymbol(ELF32BE, Rel); - auto *ELF64BE = cast<ELF64BEObjectFile>(Obj); - return getRelocationSymbol(ELF64BE, Rel); + return getRelocationSymbol(cast<ELF64LEObjectFile>(Obj), Rel); } } // anonymous namespace |