forked from OSchip/llvm-project
[ELF][MIPS] Simplify `if` condition. NFC
In case of MIPS ABI relocation has R_GOTREL expression's type iif the relocation type is either R_MIPS_GPREL16 or R_MIPS_GPREL32. So it is enough to check expression's type only. llvm-svn: 268741
This commit is contained in:
parent
1771948d72
commit
1a728fdf5c
|
@ -746,8 +746,7 @@ void Writer<ELFT>::scanRelocs(InputSectionBase<ELFT> &C, ArrayRef<RelTy> Rels) {
|
|||
// can process some of it and and just ask the dynamic linker to add the
|
||||
// load address.
|
||||
if (!Config->Pic || isStaticLinkTimeConstant<ELFT>(Expr, Type, Body)) {
|
||||
if (Config->EMachine == EM_MIPS && Body.isLocal() &&
|
||||
(Type == R_MIPS_GPREL16 || Type == R_MIPS_GPREL32))
|
||||
if (Config->EMachine == EM_MIPS && Body.isLocal() && Expr == R_GOTREL)
|
||||
Addend += File.getMipsGp0();
|
||||
C.Relocations.push_back({Expr, Type, Offset, Addend, &Body});
|
||||
continue;
|
||||
|
|
Loading…
Reference in New Issue