[lld] r265143 - Pass a const pointer to getImplicitAddend. NFC.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 1 07:36:09 PDT 2016
Author: rafael
Date: Fri Apr 1 09:36:09 2016
New Revision: 265143
URL: http://llvm.org/viewvc/llvm-project?rev=265143&view=rev
Log:
Pass a const pointer to getImplicitAddend. NFC.
Modified:
lld/trunk/ELF/Target.cpp
lld/trunk/ELF/Target.h
Modified: lld/trunk/ELF/Target.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Target.cpp?rev=265143&r1=265142&r2=265143&view=diff
==============================================================================
--- lld/trunk/ELF/Target.cpp (original)
+++ lld/trunk/ELF/Target.cpp Fri Apr 1 09:36:09 2016
@@ -70,7 +70,7 @@ namespace {
class X86TargetInfo final : public TargetInfo {
public:
X86TargetInfo();
- uint64_t getImplicitAddend(uint8_t *Buf, uint32_t Type) const override;
+ uint64_t getImplicitAddend(const uint8_t *Buf, uint32_t Type) const override;
void writeGotPltHeader(uint8_t *Buf) const override;
uint32_t getDynRel(uint32_t Type) const override;
uint32_t getTlsGotRel(uint32_t Type) const override;
@@ -192,7 +192,7 @@ public:
template <class ELFT> class MipsTargetInfo final : public TargetInfo {
public:
MipsTargetInfo();
- uint64_t getImplicitAddend(uint8_t *Buf, uint32_t Type) const override;
+ uint64_t getImplicitAddend(const uint8_t *Buf, uint32_t Type) const override;
uint32_t getDynRel(uint32_t Type) const override;
void writeGotPlt(uint8_t *Buf, uint64_t Plt) const override;
void writePltZero(uint8_t *Buf) const override;
@@ -242,7 +242,8 @@ TargetInfo *createTarget() {
TargetInfo::~TargetInfo() {}
-uint64_t TargetInfo::getImplicitAddend(uint8_t *Buf, uint32_t Type) const {
+uint64_t TargetInfo::getImplicitAddend(const uint8_t *Buf,
+ uint32_t Type) const {
return 0;
}
@@ -521,7 +522,8 @@ bool X86TargetInfo::refersToGotEntry(uin
return Type == R_386_GOT32;
}
-uint64_t X86TargetInfo::getImplicitAddend(uint8_t *Buf, uint32_t Type) const {
+uint64_t X86TargetInfo::getImplicitAddend(const uint8_t *Buf,
+ uint32_t Type) const {
switch (Type) {
default:
return 0;
@@ -1639,7 +1641,7 @@ void MipsTargetInfo<ELFT>::writeGotPlt(u
static uint16_t mipsHigh(uint64_t V) { return (V + 0x8000) >> 16; }
template <endianness E, uint8_t BSIZE, uint8_t SHIFT>
-static int64_t getPcRelocAddend(uint8_t *Loc) {
+static int64_t getPcRelocAddend(const uint8_t *Loc) {
uint32_t Instr = read32<E>(Loc);
uint32_t Mask = 0xffffffff >> (32 - BSIZE);
return SignExtend64<BSIZE + SHIFT>((Instr & Mask) << SHIFT);
@@ -1669,7 +1671,7 @@ static void writeMipsLo16(uint8_t *Loc,
write32<E>(Loc, (Instr & 0xffff0000) | (V & 0xffff));
}
-template <endianness E> static int16_t readSignedLo16(uint8_t *Loc) {
+template <endianness E> static int16_t readSignedLo16(const uint8_t *Loc) {
return SignExtend32<16>(read32<E>(Loc) & 0xffff);
}
@@ -1764,7 +1766,7 @@ bool MipsTargetInfo<ELFT>::needsThunk(ui
}
template <class ELFT>
-uint64_t MipsTargetInfo<ELFT>::getImplicitAddend(uint8_t *Buf,
+uint64_t MipsTargetInfo<ELFT>::getImplicitAddend(const uint8_t *Buf,
uint32_t Type) const {
const endianness E = ELFT::TargetEndianness;
switch (Type) {
Modified: lld/trunk/ELF/Target.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Target.h?rev=265143&r1=265142&r2=265143&view=diff
==============================================================================
--- lld/trunk/ELF/Target.h (original)
+++ lld/trunk/ELF/Target.h Fri Apr 1 09:36:09 2016
@@ -32,7 +32,7 @@ public:
virtual void writeGotHeader(uint8_t *Buf) const {}
virtual void writeGotPltHeader(uint8_t *Buf) const {}
virtual void writeGotPlt(uint8_t *Buf, uint64_t Plt) const {};
- virtual uint64_t getImplicitAddend(uint8_t *Buf, uint32_t Type) const;
+ virtual uint64_t getImplicitAddend(const uint8_t *Buf, uint32_t Type) const;
// If lazy binding is supported, the first entry of the PLT has code
// to call the dynamic linker to resolve PLT entries the first time
More information about the llvm-commits
mailing list