#include "OutputSections.h"
#include "Symbols.h"
#include "SyntheticSections.h"
#include "Target.h"
#include "lld/Common/ErrorHandler.h"
#include "llvm/Support/Endian.h"
usingnamespacellvm;
usingnamespacellvm::support::endian;
usingnamespacellvm::ELF;
usingnamespacelld;
usingnamespacelld::elf;
namespace {
class X86 : public TargetInfo { … };
}
X86::X86(Ctx &ctx) : … { … }
int X86::getTlsGdRelaxSkip(RelType type) const { … }
RelExpr X86::getRelExpr(RelType type, const Symbol &s,
const uint8_t *loc) const { … }
RelExpr X86::adjustTlsExpr(RelType type, RelExpr expr) const { … }
void X86::writeGotPltHeader(uint8_t *buf) const { … }
void X86::writeGotPlt(uint8_t *buf, const Symbol &s) const { … }
void X86::writeIgotPlt(uint8_t *buf, const Symbol &s) const { … }
RelType X86::getDynRel(RelType type) const { … }
void X86::writePltHeader(uint8_t *buf) const { … }
void X86::writePlt(uint8_t *buf, const Symbol &sym,
uint64_t pltEntryAddr) const { … }
int64_t X86::getImplicitAddend(const uint8_t *buf, RelType type) const { … }
void X86::relocate(uint8_t *loc, const Relocation &rel, uint64_t val) const { … }
void X86::relaxTlsGdToLe(uint8_t *loc, const Relocation &rel,
uint64_t val) const { … }
void X86::relaxTlsGdToIe(uint8_t *loc, const Relocation &rel,
uint64_t val) const { … }
void X86::relaxTlsIeToLe(uint8_t *loc, const Relocation &rel,
uint64_t val) const { … }
void X86::relaxTlsLdToLe(uint8_t *loc, const Relocation &rel,
uint64_t val) const { … }
void X86::relocateAlloc(InputSectionBase &sec, uint8_t *buf) const { … }
namespace {
class IntelIBT : public X86 { … };
}
void IntelIBT::writeGotPlt(uint8_t *buf, const Symbol &s) const { … }
void IntelIBT::writePlt(uint8_t *buf, const Symbol &sym,
uint64_t ) const { … }
void IntelIBT::writeIBTPlt(uint8_t *buf, size_t numEntries) const { … }
namespace {
class RetpolinePic : public X86 { … };
class RetpolineNoPic : public X86 { … };
}
RetpolinePic::RetpolinePic(Ctx &ctx) : … { … }
void RetpolinePic::writeGotPlt(uint8_t *buf, const Symbol &s) const { … }
void RetpolinePic::writePltHeader(uint8_t *buf) const { … }
void RetpolinePic::writePlt(uint8_t *buf, const Symbol &sym,
uint64_t pltEntryAddr) const { … }
RetpolineNoPic::RetpolineNoPic(Ctx &ctx) : … { … }
void RetpolineNoPic::writeGotPlt(uint8_t *buf, const Symbol &s) const { … }
void RetpolineNoPic::writePltHeader(uint8_t *buf) const { … }
void RetpolineNoPic::writePlt(uint8_t *buf, const Symbol &sym,
uint64_t pltEntryAddr) const { … }
void elf::setX86TargetInfo(Ctx &ctx) { … }