diff options
| author | Rui Ueyama <ruiu@google.com> | 2016-07-12 23:28:30 +0000 |
|---|---|---|
| committer | Rui Ueyama <ruiu@google.com> | 2016-07-12 23:28:30 +0000 |
| commit | b933df1835ffb47bcededacfd568f63bc191acb8 (patch) | |
| tree | 0cf8eeb6d67ca5319433f405438cc387666a1374 /lld/ELF/Thunks.cpp | |
| parent | e71c08f84c1a5cc12ef6db728b095d9577b61132 (diff) | |
| download | bcm5719-llvm-b933df1835ffb47bcededacfd568f63bc191acb8.tar.gz bcm5719-llvm-b933df1835ffb47bcededacfd568f63bc191acb8.zip | |
Simplify. NFC.
Config->Pic is true if (Config->Pie || Config->Shared) is true,
so this extra check was redundant.
llvm-svn: 275234
Diffstat (limited to 'lld/ELF/Thunks.cpp')
| -rw-r--r-- | lld/ELF/Thunks.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lld/ELF/Thunks.cpp b/lld/ELF/Thunks.cpp index 0e003513120..1ebbb17f303 100644 --- a/lld/ELF/Thunks.cpp +++ b/lld/ELF/Thunks.cpp @@ -186,22 +186,20 @@ template <class ELFT> Thunk<ELFT>::~Thunk() {} template <class ELFT> static Thunk<ELFT> *createThunkArm(uint32_t Reloc, SymbolBody &S, InputSection<ELFT> &IS) { - bool NeedsPI = Config->Pic || Config->Pie || Config->Shared; - BumpPtrAllocator &Alloc = IS.getFile()->Alloc; - // ARM relocations need ARM to Thumb interworking Thunks. // Thumb relocations need Thumb to ARM relocations. // Use position independent Thunks if we require position independent code. + BumpPtrAllocator &Alloc = IS.getFile()->Alloc; switch (Reloc) { case R_ARM_PC24: case R_ARM_PLT32: case R_ARM_JUMP24: - if (NeedsPI) + if (Config->Pic) return new (Alloc) ARMToThumbV7PILongThunk<ELFT>(S, IS); return new (Alloc) ARMToThumbV7ABSLongThunk<ELFT>(S, IS); case R_ARM_THM_JUMP19: case R_ARM_THM_JUMP24: - if (NeedsPI) + if (Config->Pic) return new (Alloc) ThumbToARMV7PILongThunk<ELFT>(S, IS); return new (Alloc) ThumbToARMV7ABSLongThunk<ELFT>(S, IS); } |

