[lld] r270847 - Removed redundant argument. NFC.
George Rimar via llvm-commits
llvm-commits at lists.llvm.org
Thu May 26 06:37:12 PDT 2016
Author: grimar
Date: Thu May 26 08:37:12 2016
New Revision: 270847
URL: http://llvm.org/viewvc/llvm-project?rev=270847&view=rev
Log:
Removed redundant argument. NFC.
Modified:
lld/trunk/ELF/Relocations.cpp
lld/trunk/ELF/Target.cpp
lld/trunk/ELF/Target.h
Modified: lld/trunk/ELF/Relocations.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Relocations.cpp?rev=270847&r1=270846&r2=270847&view=diff
==============================================================================
--- lld/trunk/ELF/Relocations.cpp (original)
+++ lld/trunk/ELF/Relocations.cpp Thu May 26 08:37:12 2016
@@ -354,7 +354,7 @@ static RelExpr adjustExpr(const elf::Obj
} else if (!Preemptible) {
if (needsPlt(Expr))
Expr = fromPlt(Expr);
- if (Expr == R_GOT_PC && Target->canRelaxGot(Type, Data, Offset))
+ if (Expr == R_GOT_PC && Target->canRelaxGot(Type, Data + Offset))
Expr = R_RELAX_GOT_PC;
}
Modified: lld/trunk/ELF/Target.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Target.cpp?rev=270847&r1=270846&r2=270847&view=diff
==============================================================================
--- lld/trunk/ELF/Target.cpp (original)
+++ lld/trunk/ELF/Target.cpp Thu May 26 08:37:12 2016
@@ -113,8 +113,7 @@ public:
int32_t Index, unsigned RelOff) const override;
void relocateOne(uint8_t *Loc, uint32_t Type, uint64_t Val) const override;
- bool canRelaxGot(uint32_t Type, const uint8_t *Data,
- uint64_t Offset) const override;
+ bool canRelaxGot(uint32_t Type, const uint8_t *Data) const override;
void relaxGot(uint8_t *Loc, uint64_t Val) const override;
void relaxTlsGdToIe(uint8_t *Loc, uint32_t Type, uint64_t Val) const override;
void relaxTlsGdToLe(uint8_t *Loc, uint32_t Type, uint64_t Val) const override;
@@ -235,8 +234,7 @@ bool TargetInfo::isTlsGlobalDynamicRel(u
return false;
}
-bool TargetInfo::canRelaxGot(uint32_t Type, const uint8_t *Data,
- uint64_t Offset) const {
+bool TargetInfo::canRelaxGot(uint32_t Type, const uint8_t *Data) const {
return false;
}
@@ -736,12 +734,11 @@ void X86_64TargetInfo::relocateOne(uint8
}
}
-bool X86_64TargetInfo::canRelaxGot(uint32_t Type, const uint8_t *Data,
- uint64_t Offset) const {
+bool X86_64TargetInfo::canRelaxGot(uint32_t Type, const uint8_t *Data) const {
if (Type != R_X86_64_GOTPCRELX && Type != R_X86_64_REX_GOTPCRELX)
return false;
- const uint8_t Op = Data[Offset - 2];
- const uint8_t ModRm = Data[Offset - 1];
+ const uint8_t Op = Data[-2];
+ const uint8_t ModRm = Data[-1];
// Relax mov.
if (Op == 0x8b)
return true;
Modified: lld/trunk/ELF/Target.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Target.h?rev=270847&r1=270846&r2=270847&view=diff
==============================================================================
--- lld/trunk/ELF/Target.h (original)
+++ lld/trunk/ELF/Target.h Thu May 26 08:37:12 2016
@@ -88,8 +88,7 @@ public:
uint32_t ThunkSize = 0;
- virtual bool canRelaxGot(uint32_t Type, const uint8_t *Data,
- uint64_t Offset) const;
+ virtual bool canRelaxGot(uint32_t Type, const uint8_t *Data) const;
virtual void relaxGot(uint8_t *Loc, uint64_t Val) const;
virtual void relaxTlsGdToIe(uint8_t *Loc, uint32_t Type, uint64_t Val) const;
virtual void relaxTlsGdToLe(uint8_t *Loc, uint32_t Type, uint64_t Val) const;
More information about the llvm-commits
mailing list