summaryrefslogtreecommitdiffstats
path: root/lld/ELF/Target.cpp
diff options
context:
space:
mode:
authorSimon Atanasyan <simon@atanasyan.com>2016-04-25 20:25:05 +0000
committerSimon Atanasyan <simon@atanasyan.com>2016-04-25 20:25:05 +0000
commit1ef1bf87dc8c26c61a2a51fea4c9d3aadda07d13 (patch)
tree89a8e80bfbd28dd4ac3f0315d3fcddcf4fe431fb /lld/ELF/Target.cpp
parentd60d96ffae95f32036819239457fd6a9243c69a3 (diff)
downloadbcm5719-llvm-1ef1bf87dc8c26c61a2a51fea4c9d3aadda07d13.tar.gz
bcm5719-llvm-1ef1bf87dc8c26c61a2a51fea4c9d3aadda07d13.zip
[ELF][MIPS] Move MIPS GOT header generation to the GotSection
MIPS is the only target requires GOT header. We already have MIPS specific code in the `GotSection` class, so move MIPS GOT header generation there and delete redundant stuff like `GotHeaderEntriesNum` field and `writeGotHeader` method. Differential Revision: http://reviews.llvm.org/D19465 llvm-svn: 267460
Diffstat (limited to 'lld/ELF/Target.cpp')
-rw-r--r--lld/ELF/Target.cpp25
1 files changed, 0 insertions, 25 deletions
diff --git a/lld/ELF/Target.cpp b/lld/ELF/Target.cpp
index 31d72bbc0e1..bc846a03cb4 100644
--- a/lld/ELF/Target.cpp
+++ b/lld/ELF/Target.cpp
@@ -179,7 +179,6 @@ public:
void writePltZero(uint8_t *Buf) const override;
void writePlt(uint8_t *Buf, uint64_t GotEntryAddr, uint64_t PltEntryAddr,
int32_t Index, unsigned RelOff) const override;
- void writeGotHeader(uint8_t *Buf) const override;
void writeThunk(uint8_t *Buf, uint64_t S) const override;
bool needsThunk(uint32_t Type, const InputFile &File,
const SymbolBody &S) const override;
@@ -1294,7 +1293,6 @@ RelExpr AMDGPUTargetInfo::getRelExpr(uint32_t Type, const SymbolBody &S) const {
}
template <class ELFT> MipsTargetInfo<ELFT>::MipsTargetInfo() {
- GotHeaderEntriesNum = 2;
GotPltHeaderEntriesNum = 2;
PageSize = 65536;
PltEntrySize = 16;
@@ -1353,29 +1351,6 @@ uint32_t MipsTargetInfo<ELFT>::getDynRel(uint32_t Type) const {
}
template <class ELFT>
-void MipsTargetInfo<ELFT>::writeGotHeader(uint8_t *Buf) const {
- typedef typename ELFT::Off Elf_Off;
- typedef typename ELFT::uint uintX_t;
-
- // Set the MSB of the second GOT slot. This is not required by any
- // MIPS ABI documentation, though.
- //
- // There is a comment in glibc saying that "The MSB of got[1] of a
- // gnu object is set to identify gnu objects," and in GNU gold it
- // says "the second entry will be used by some runtime loaders".
- // But how this field is being used is unclear.
- //
- // We are not really willing to mimic other linkers behaviors
- // without understanding why they do that, but because all files
- // generated by GNU tools have this special GOT value, and because
- // we've been doing this for years, it is probably a safe bet to
- // keep doing this for now. We really need to revisit this to see
- // if we had to do this.
- auto *P = reinterpret_cast<Elf_Off *>(Buf);
- P[1] = uintX_t(1) << (ELFT::Is64Bits ? 63 : 31);
-}
-
-template <class ELFT>
void MipsTargetInfo<ELFT>::writeGotPlt(uint8_t *Buf, uint64_t Plt) const {
write32<ELFT::TargetEndianness>(Buf, Out<ELFT>::Plt->getVA());
}
OpenPOWER on IntegriCloud