diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2020-07-26 19:36:28 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2020-07-26 19:36:28 +0000 |
commit | cfca06d7963fa0909f90483b42a6d7d194d01e08 (patch) | |
tree | 209fb2a2d68f8f277793fc8df46c753d31bc853b /lld/ELF/Target.cpp | |
parent | 706b4fc47bbc608932d3b491ae19a3b9cde9497b (diff) |
Notes
Diffstat (limited to 'lld/ELF/Target.cpp')
-rw-r--r-- | lld/ELF/Target.cpp | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/lld/ELF/Target.cpp b/lld/ELF/Target.cpp index 70a68fd8db9e..6abd8b452e23 100644 --- a/lld/ELF/Target.cpp +++ b/lld/ELF/Target.cpp @@ -35,19 +35,19 @@ using namespace llvm; using namespace llvm::object; using namespace llvm::ELF; +using namespace lld; +using namespace lld::elf; -namespace lld { -std::string toString(elf::RelType type) { +const TargetInfo *elf::target; + +std::string lld::toString(RelType type) { StringRef s = getELFRelocationTypeName(elf::config->emachine, type); if (s == "Unknown") return ("Unknown (" + Twine(type) + ")").str(); - return s; + return std::string(s); } -namespace elf { -const TargetInfo *target; - -TargetInfo *getTarget() { +TargetInfo *elf::getTarget() { switch (config->emachine) { case EM_386: case EM_IAMCU: @@ -95,7 +95,7 @@ template <class ELFT> static ErrorPlace getErrPlace(const uint8_t *loc) { assert(loc != nullptr); for (InputSectionBase *d : inputSections) { auto *isec = cast<InputSection>(d); - if (!isec->getParent()) + if (!isec->getParent() || (isec->type & SHT_NOBITS)) continue; const uint8_t *isecLoc = @@ -112,7 +112,7 @@ template <class ELFT> static ErrorPlace getErrPlace(const uint8_t *loc) { return {}; } -ErrorPlace getErrorPlace(const uint8_t *loc) { +ErrorPlace elf::getErrorPlace(const uint8_t *loc) { switch (config->ekind) { case ELF32LEKind: return getErrPlace<ELF32LE>(loc); @@ -155,26 +155,27 @@ RelExpr TargetInfo::adjustRelaxExpr(RelType type, const uint8_t *data, return expr; } -void TargetInfo::relaxGot(uint8_t *loc, RelType type, uint64_t val) const { +void TargetInfo::relaxGot(uint8_t *loc, const Relocation &rel, + uint64_t val) const { llvm_unreachable("Should not have claimed to be relaxable"); } -void TargetInfo::relaxTlsGdToLe(uint8_t *loc, RelType type, +void TargetInfo::relaxTlsGdToLe(uint8_t *loc, const Relocation &rel, uint64_t val) const { llvm_unreachable("Should not have claimed to be relaxable"); } -void TargetInfo::relaxTlsGdToIe(uint8_t *loc, RelType type, +void TargetInfo::relaxTlsGdToIe(uint8_t *loc, const Relocation &rel, uint64_t val) const { llvm_unreachable("Should not have claimed to be relaxable"); } -void TargetInfo::relaxTlsIeToLe(uint8_t *loc, RelType type, +void TargetInfo::relaxTlsIeToLe(uint8_t *loc, const Relocation &rel, uint64_t val) const { llvm_unreachable("Should not have claimed to be relaxable"); } -void TargetInfo::relaxTlsLdToLe(uint8_t *loc, RelType type, +void TargetInfo::relaxTlsLdToLe(uint8_t *loc, const Relocation &rel, uint64_t val) const { llvm_unreachable("Should not have claimed to be relaxable"); } @@ -185,6 +186,3 @@ uint64_t TargetInfo::getImageBase() const { return *config->imageBase; return config->isPic ? 0 : defaultImageBase; } - -} // namespace elf -} // namespace lld |