diff options
Diffstat (limited to 'lld/lib/ReaderWriter')
24 files changed, 53 insertions, 55 deletions
diff --git a/lld/lib/ReaderWriter/ELF/AArch64/AArch64RelocationHandler.cpp b/lld/lib/ReaderWriter/ELF/AArch64/AArch64RelocationHandler.cpp index b4b0a6d36d6..035d7600587 100644 --- a/lld/lib/ReaderWriter/ELF/AArch64/AArch64RelocationHandler.cpp +++ b/lld/lib/ReaderWriter/ELF/AArch64/AArch64RelocationHandler.cpp @@ -400,7 +400,7 @@ static void relocR_AARCH64_TLSLE_ADD_TPREL_LO12_NC(uint8_t *location, } std::error_code AArch64TargetRelocationHandler::applyRelocation( - ELFWriter &writer, llvm::FileOutputBuffer &buf, const lld::AtomLayout &atom, + ELFWriter &writer, llvm::FileOutputBuffer &buf, const AtomLayout &atom, const Reference &ref) const { uint8_t *atomContent = buf.getBufferStart() + atom._fileOffset; uint8_t *loc = atomContent + ref.offsetInAtom(); diff --git a/lld/lib/ReaderWriter/ELF/AArch64/AArch64RelocationHandler.h b/lld/lib/ReaderWriter/ELF/AArch64/AArch64RelocationHandler.h index 0f3e3b8156b..a11a02e97bb 100644 --- a/lld/lib/ReaderWriter/ELF/AArch64/AArch64RelocationHandler.h +++ b/lld/lib/ReaderWriter/ELF/AArch64/AArch64RelocationHandler.h @@ -18,7 +18,7 @@ namespace elf { class AArch64TargetRelocationHandler final : public TargetRelocationHandler { public: std::error_code applyRelocation(ELFWriter &, llvm::FileOutputBuffer &, - const lld::AtomLayout &, + const AtomLayout &, const Reference &) const override; }; diff --git a/lld/lib/ReaderWriter/ELF/ARM/ARMRelocationHandler.cpp b/lld/lib/ReaderWriter/ELF/ARM/ARMRelocationHandler.cpp index b4336a44bf9..ce5f14c95a3 100644 --- a/lld/lib/ReaderWriter/ELF/ARM/ARMRelocationHandler.cpp +++ b/lld/lib/ReaderWriter/ELF/ARM/ARMRelocationHandler.cpp @@ -497,7 +497,7 @@ static void relocR_ARM_LDR_PC_G2(uint8_t *location, uint64_t P, uint64_t S, } std::error_code ARMTargetRelocationHandler::applyRelocation( - ELFWriter &writer, llvm::FileOutputBuffer &buf, const lld::AtomLayout &atom, + ELFWriter &writer, llvm::FileOutputBuffer &buf, const AtomLayout &atom, const Reference &ref) const { uint8_t *atomContent = buf.getBufferStart() + atom._fileOffset; uint8_t *loc = atomContent + ref.offsetInAtom(); diff --git a/lld/lib/ReaderWriter/ELF/ARM/ARMRelocationHandler.h b/lld/lib/ReaderWriter/ELF/ARM/ARMRelocationHandler.h index 80a2f3d4850..a1f3d091f20 100644 --- a/lld/lib/ReaderWriter/ELF/ARM/ARMRelocationHandler.h +++ b/lld/lib/ReaderWriter/ELF/ARM/ARMRelocationHandler.h @@ -22,7 +22,7 @@ public: ARMTargetRelocationHandler(ARMTargetLayout &layout) : _armLayout(layout) {} std::error_code applyRelocation(ELFWriter &, llvm::FileOutputBuffer &, - const lld::AtomLayout &, + const AtomLayout &, const Reference &) const override; private: diff --git a/lld/lib/ReaderWriter/ELF/Atoms.h b/lld/lib/ReaderWriter/ELF/Atoms.h index d1091a8a9dd..9488532058d 100644 --- a/lld/lib/ReaderWriter/ELF/Atoms.h +++ b/lld/lib/ReaderWriter/ELF/Atoms.h @@ -102,7 +102,7 @@ private: /// \brief ELFUndefinedAtom: These atoms store undefined symbols and are place /// holders that will be replaced by defined atoms later in the linking process. -template <class ELFT> class ELFUndefinedAtom : public lld::UndefinedAtom { +template <class ELFT> class ELFUndefinedAtom : public UndefinedAtom { typedef llvm::object::Elf_Sym_Impl<ELFT> Elf_Sym; public: diff --git a/lld/lib/ReaderWriter/ELF/DynamicFile.cpp b/lld/lib/ReaderWriter/ELF/DynamicFile.cpp index bf81f07ecfc..4a6ee833a74 100644 --- a/lld/lib/ReaderWriter/ELF/DynamicFile.cpp +++ b/lld/lib/ReaderWriter/ELF/DynamicFile.cpp @@ -26,7 +26,7 @@ DynamicFile<ELFT>::DynamicFile(std::unique_ptr<MemoryBuffer> mb, template <typename ELFT> std::error_code DynamicFile<ELFT>::isCompatible(const MemoryBuffer &mb, ELFLinkingContext &ctx) { - return lld::elf::isCompatible<ELFT>(mb, ctx); + return elf::isCompatible<ELFT>(mb, ctx); } template <class ELFT> diff --git a/lld/lib/ReaderWriter/ELF/DynamicLibraryWriter.h b/lld/lib/ReaderWriter/ELF/DynamicLibraryWriter.h index a5c14cffae6..5f2c1d1a828 100644 --- a/lld/lib/ReaderWriter/ELF/DynamicLibraryWriter.h +++ b/lld/lib/ReaderWriter/ELF/DynamicLibraryWriter.h @@ -68,7 +68,7 @@ void DynamicLibraryWriter<ELFT>::createImplicitFiles( template <class ELFT> void DynamicLibraryWriter<ELFT>::finalizeDefaultAtomValues() { OutputELFWriter<ELFT>::finalizeDefaultAtomValues(); - lld::AtomLayout *underScoreEndAtom = this->_layout.findAbsoluteAtom("_end"); + AtomLayout *underScoreEndAtom = this->_layout.findAbsoluteAtom("_end"); assert(underScoreEndAtom); if (auto bssSection = this->_layout.findOutputSection(".bss")) { diff --git a/lld/lib/ReaderWriter/ELF/ELFFile.cpp b/lld/lib/ReaderWriter/ELF/ELFFile.cpp index e25662feefd..ab2ec605687 100644 --- a/lld/lib/ReaderWriter/ELF/ELFFile.cpp +++ b/lld/lib/ReaderWriter/ELF/ELFFile.cpp @@ -30,7 +30,7 @@ ELFFile<ELFT>::ELFFile(std::unique_ptr<MemoryBuffer> mb, ELFLinkingContext &ctx) template <typename ELFT> std::error_code ELFFile<ELFT>::isCompatible(const MemoryBuffer &mb, ELFLinkingContext &ctx) { - return lld::elf::isCompatible<ELFT>(mb, ctx); + return elf::isCompatible<ELFT>(mb, ctx); } template <typename ELFT> @@ -319,7 +319,7 @@ template <class ELFT> std::error_code ELFFile<ELFT>::createAtoms() { followOn = anonFollowedBy; } else { followOn = new (_readerStorage) - ELFReference<ELFT>(lld::Reference::kindLayoutAfter); + ELFReference<ELFT>(Reference::kindLayoutAfter); previousAtom->addReference(followOn); } } @@ -362,7 +362,7 @@ template <class ELFT> std::error_code ELFFile<ELFT>::createAtoms() { // If this is the last atom, let's not create a followon reference. if (anonAtom && (si + 1) != se) { anonFollowedBy = new (_readerStorage) - ELFReference<ELFT>(lld::Reference::kindLayoutAfter); + ELFReference<ELFT>(Reference::kindLayoutAfter); anonAtom->addReference(anonFollowedBy); } } @@ -429,7 +429,7 @@ std::error_code ELFFile<ELFT>::handleGnuLinkOnceSection( for (auto ha : atomsForSection[*sectionName]) { _groupChild[ha->symbol()] = std::make_pair(*sectionName, section); ELFReference<ELFT> *ref = - new (_readerStorage) ELFReference<ELFT>(lld::Reference::kindGroupChild); + new (_readerStorage) ELFReference<ELFT>(Reference::kindGroupChild); ref->setTarget(ha); refs.push_back(ref); } @@ -490,8 +490,8 @@ std::error_code ELFFile<ELFT>::handleSectionGroup( for (auto name : sectionNames) { for (auto ha : atomsForSection[name]) { _groupChild[ha->symbol()] = std::make_pair(*symbolName, section); - ELFReference<ELFT> *ref = new (_readerStorage) - ELFReference<ELFT>(lld::Reference::kindGroupChild); + ELFReference<ELFT> *ref = + new (_readerStorage) ELFReference<ELFT>(Reference::kindGroupChild); ref->setTarget(ha); refs.push_back(ref); } @@ -631,7 +631,7 @@ void ELFFile<ELFT>::updateReferenceForMergeStringAccess(ELFReference<ELFT> *ref, template <class ELFT> void ELFFile<ELFT>::updateReferences() { for (auto &ri : _references) { - if (ri->kindNamespace() != lld::Reference::KindNamespace::ELF) + if (ri->kindNamespace() != Reference::KindNamespace::ELF) continue; const Elf_Sym *symbol = _objFile->getSymbol(ri->targetSymbolIndex()); const Elf_Shdr *shdr = _objFile->getSection(symbol); diff --git a/lld/lib/ReaderWriter/ELF/Hexagon/HexagonLinkingContext.cpp b/lld/lib/ReaderWriter/ELF/Hexagon/HexagonLinkingContext.cpp index b4fdf56028c..11eabf7e26f 100644 --- a/lld/lib/ReaderWriter/ELF/Hexagon/HexagonLinkingContext.cpp +++ b/lld/lib/ReaderWriter/ELF/Hexagon/HexagonLinkingContext.cpp @@ -13,7 +13,7 @@ namespace lld { namespace elf { -std::unique_ptr<lld::ELFLinkingContext> +std::unique_ptr<ELFLinkingContext> createHexagonLinkingContext(llvm::Triple triple) { if (triple.getArch() == llvm::Triple::hexagon) return llvm::make_unique<HexagonLinkingContext>(triple); diff --git a/lld/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.cpp b/lld/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.cpp index a1ce1ecfe94..fc7ab1ebb77 100644 --- a/lld/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.cpp +++ b/lld/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.cpp @@ -224,7 +224,7 @@ static void relocHexGOTREL_32(uint8_t *loc, uint64_t P, uint64_t S, uint64_t A, } std::error_code HexagonTargetRelocationHandler::applyRelocation( - ELFWriter &writer, llvm::FileOutputBuffer &buf, const lld::AtomLayout &atom, + ELFWriter &writer, llvm::FileOutputBuffer &buf, const AtomLayout &atom, const Reference &ref) const { uint8_t *atomContent = buf.getBufferStart() + atom._fileOffset; uint8_t *loc = atomContent + ref.offsetInAtom(); diff --git a/lld/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.h b/lld/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.h index 96cec108c4f..6afba0ddb8f 100644 --- a/lld/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.h +++ b/lld/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.h @@ -22,7 +22,7 @@ public: : _targetLayout(layout) {} std::error_code applyRelocation(ELFWriter &, llvm::FileOutputBuffer &, - const lld::AtomLayout &, + const AtomLayout &, const Reference &) const override; private: diff --git a/lld/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp b/lld/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp index cc2c7795be7..cce7259bb9c 100644 --- a/lld/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp +++ b/lld/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp @@ -314,8 +314,8 @@ void HexagonLinkingContext::addPasses(PassManager &pm) { void SDataSection::doPreFlight() { // sort the atoms on the alignments they have been set - std::stable_sort(_atoms.begin(), _atoms.end(), [](const lld::AtomLayout *A, - const lld::AtomLayout *B) { + std::stable_sort(_atoms.begin(), _atoms.end(), [](const AtomLayout *A, + const AtomLayout *B) { const DefinedAtom *definedAtomA = cast<DefinedAtom>(A->_atom); const DefinedAtom *definedAtomB = cast<DefinedAtom>(B->_atom); int64_t alignmentA = definedAtomA->alignment().value; @@ -353,7 +353,7 @@ const AtomLayout *SDataSection::appendAtom(const Atom *atom) { const DefinedAtom *definedAtom = cast<DefinedAtom>(atom); DefinedAtom::Alignment atomAlign = definedAtom->alignment(); uint64_t alignment = atomAlign.value; - _atoms.push_back(new (_alloc) lld::AtomLayout(atom, 0, 0)); + _atoms.push_back(new (_alloc) AtomLayout(atom, 0, 0)); // Set the section alignment to the largest alignment // std::max doesn't support uint64_t if (_alignment < alignment) diff --git a/lld/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.h b/lld/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.h index d66a28213ef..2ff19ad61c4 100644 --- a/lld/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.h +++ b/lld/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.h @@ -30,7 +30,7 @@ public: /// \brief Does this section have an output segment. bool hasOutputSegment() const override { return true; } - const lld::AtomLayout *appendAtom(const Atom *atom) override; + const AtomLayout *appendAtom(const Atom *atom) override; }; /// \brief TargetLayout for Hexagon diff --git a/lld/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.cpp b/lld/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.cpp index 94906bd65e1..7b3b97ccd21 100644 --- a/lld/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.cpp +++ b/lld/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.cpp @@ -38,7 +38,7 @@ public: std::error_code applyRelocation(ELFWriter &writer, llvm::FileOutputBuffer &buf, - const lld::AtomLayout &atom, + const AtomLayout &atom, const Reference &ref) const override; private: @@ -556,9 +556,9 @@ static void relocWrite(uint64_t data, const MipsRelocationParams ¶ms, template <class ELFT> std::error_code RelocationHandler<ELFT>::applyRelocation( - ELFWriter &writer, llvm::FileOutputBuffer &buf, const lld::AtomLayout &atom, + ELFWriter &writer, llvm::FileOutputBuffer &buf, const AtomLayout &atom, const Reference &ref) const { - if (ref.kindNamespace() != lld::Reference::KindNamespace::ELF) + if (ref.kindNamespace() != Reference::KindNamespace::ELF) return std::error_code(); assert(ref.kindArch() == Reference::KindArch::Mips); diff --git a/lld/lib/ReaderWriter/ELF/Mips/MipsRelocationPass.cpp b/lld/lib/ReaderWriter/ELF/Mips/MipsRelocationPass.cpp index fd2f6987cb5..df76db59015 100644 --- a/lld/lib/ReaderWriter/ELF/Mips/MipsRelocationPass.cpp +++ b/lld/lib/ReaderWriter/ELF/Mips/MipsRelocationPass.cpp @@ -507,7 +507,7 @@ void RelocationPass<ELFT>::handleReference(const MipsELFDefinedAtom<ELFT> &atom, Reference &ref) { if (!ref.target()) return; - if (ref.kindNamespace() != lld::Reference::KindNamespace::ELF) + if (ref.kindNamespace() != Reference::KindNamespace::ELF) return; assert(ref.kindArch() == Reference::KindArch::Mips); switch (ref.kindValue()) { @@ -602,7 +602,7 @@ void RelocationPass<ELFT>::collectReferenceInfo( const MipsELFDefinedAtom<ELFT> &atom, Reference &ref) { if (!ref.target()) return; - if (ref.kindNamespace() != lld::Reference::KindNamespace::ELF) + if (ref.kindNamespace() != Reference::KindNamespace::ELF) return; auto refKind = ref.kindValue(); diff --git a/lld/lib/ReaderWriter/ELF/Mips/MipsSectionChunks.h b/lld/lib/ReaderWriter/ELF/Mips/MipsSectionChunks.h index 56cb8148f2e..9b271b0976a 100644 --- a/lld/lib/ReaderWriter/ELF/Mips/MipsSectionChunks.h +++ b/lld/lib/ReaderWriter/ELF/Mips/MipsSectionChunks.h @@ -152,11 +152,11 @@ public: return ia == _posMap.end() && ib != _posMap.end(); } - const lld::AtomLayout *appendAtom(const Atom *atom) override { + const AtomLayout *appendAtom(const Atom *atom) override { const DefinedAtom *da = dyn_cast<DefinedAtom>(atom); for (const auto &r : *da) { - if (r->kindNamespace() != lld::Reference::KindNamespace::ELF) + if (r->kindNamespace() != Reference::KindNamespace::ELF) continue; assert(r->kindArch() == Reference::KindArch::Mips); switch (r->kindValue()) { @@ -211,13 +211,13 @@ public: return it != _pltLayoutMap.end() ? it->second : nullptr; } - const lld::AtomLayout *appendAtom(const Atom *atom) override { + const AtomLayout *appendAtom(const Atom *atom) override { const auto *layout = AtomSection<ELFT>::appendAtom(atom); const DefinedAtom *da = cast<DefinedAtom>(atom); for (const auto &r : *da) { - if (r->kindNamespace() != lld::Reference::KindNamespace::ELF) + if (r->kindNamespace() != Reference::KindNamespace::ELF) continue; assert(r->kindArch() == Reference::KindArch::Mips); if (r->kindValue() == LLD_R_MIPS_STO_PLT) { diff --git a/lld/lib/ReaderWriter/ELF/SectionChunks.cpp b/lld/lib/ReaderWriter/ELF/SectionChunks.cpp index 4926770ad81..365d5052ec2 100644 --- a/lld/lib/ReaderWriter/ELF/SectionChunks.cpp +++ b/lld/lib/ReaderWriter/ELF/SectionChunks.cpp @@ -161,7 +161,7 @@ uint64_t AtomSection<ELFT>::alignOffset(uint64_t offset, // contains the atom, the atom file offset, the atom virtual address // the atom file offset is aligned appropriately as set by the Reader template <class ELFT> -const lld::AtomLayout *AtomSection<ELFT>::appendAtom(const Atom *atom) { +const AtomLayout *AtomSection<ELFT>::appendAtom(const Atom *atom) { const DefinedAtom *definedAtom = cast<DefinedAtom>(atom); DefinedAtom::Alignment atomAlign = definedAtom->alignment(); @@ -183,7 +183,7 @@ const lld::AtomLayout *AtomSection<ELFT>::appendAtom(const Atom *atom) { case DefinedAtom::typeThreadData: case DefinedAtom::typeRONote: case DefinedAtom::typeRWNote: - _atoms.push_back(new (_alloc) lld::AtomLayout(atom, fOffset, 0)); + _atoms.push_back(new (_alloc) AtomLayout(atom, fOffset, 0)); this->_fsize = fOffset + definedAtom->size(); this->_msize = mOffset + definedAtom->size(); DEBUG_WITH_TYPE("Section", llvm::dbgs() @@ -192,7 +192,7 @@ const lld::AtomLayout *AtomSection<ELFT>::appendAtom(const Atom *atom) { << fOffset << "\n"); break; case DefinedAtom::typeNoAlloc: - _atoms.push_back(new (_alloc) lld::AtomLayout(atom, fOffset, 0)); + _atoms.push_back(new (_alloc) AtomLayout(atom, fOffset, 0)); this->_fsize = fOffset + definedAtom->size(); DEBUG_WITH_TYPE("Section", llvm::dbgs() << "[" << this->name() << " " << this << "] " @@ -201,7 +201,7 @@ const lld::AtomLayout *AtomSection<ELFT>::appendAtom(const Atom *atom) { break; case DefinedAtom::typeThreadZeroFill: case DefinedAtom::typeZeroFill: - _atoms.push_back(new (_alloc) lld::AtomLayout(atom, mOffset, 0)); + _atoms.push_back(new (_alloc) AtomLayout(atom, mOffset, 0)); this->_msize = mOffset + definedAtom->size(); break; default: @@ -249,7 +249,7 @@ void AtomSection<ELFT>::write(ELFWriter *writer, TargetLayout<ELFT> &layout, llvm::FileOutputBuffer &buffer) { uint8_t *chunkBuffer = buffer.getBufferStart(); bool success = true; - parallel_for_each(_atoms.begin(), _atoms.end(), [&](lld::AtomLayout *ai) { + parallel_for_each(_atoms.begin(), _atoms.end(), [&](AtomLayout *ai) { DEBUG_WITH_TYPE("Section", llvm::dbgs() << "Writing atom: " << ai->_atom->name() << " | " << ai->_fileOffset << "\n"); @@ -461,8 +461,7 @@ void SymbolTable<ELFT>::addUndefinedAtom(Elf_Sym &sym, /// information template <class ELFT> void SymbolTable<ELFT>::addSymbol(const Atom *atom, int32_t sectionIndex, - uint64_t addr, - const lld::AtomLayout *atomLayout) { + uint64_t addr, const AtomLayout *atomLayout) { Elf_Sym symbol; if (atom->name().empty()) @@ -548,7 +547,7 @@ template <class ELFT> void DynamicSymbolTable<ELFT>::finalize() { // don't have their addresses known until addresses have been assigned // so let's update the symbol values after they have got assigned for (auto &ste : this->_symbolTable) { - const lld::AtomLayout *atomLayout = ste._atomLayout; + const AtomLayout *atomLayout = ste._atomLayout; if (!atomLayout) continue; ste._symbol.st_value = atomLayout->_virtualAddr; diff --git a/lld/lib/ReaderWriter/ELF/SectionChunks.h b/lld/lib/ReaderWriter/ELF/SectionChunks.h index 6e6826c3d6c..7b78e265cd7 100644 --- a/lld/lib/ReaderWriter/ELF/SectionChunks.h +++ b/lld/lib/ReaderWriter/ELF/SectionChunks.h @@ -156,7 +156,7 @@ public: // \brief Append an atom to a Section. The atom gets pushed into a vector // contains the atom, the atom file offset, the atom virtual address // the atom file offset is aligned appropriately as set by the Reader - virtual const lld::AtomLayout *appendAtom(const Atom *atom); + virtual const AtomLayout *appendAtom(const Atom *atom); /// \brief Set the virtual address of each Atom in the Section. This /// routine gets called after the linker fixes up the virtual address @@ -176,7 +176,7 @@ public: int64_t atomflags() const { return _contentPermissions; } /// Atom Iterators - typedef typename std::vector<lld::AtomLayout *>::iterator atom_iter; + typedef typename std::vector<AtomLayout *>::iterator atom_iter; range<atom_iter> atoms() { return _atoms; } @@ -192,7 +192,7 @@ protected: int32_t _contentType; int32_t _contentPermissions; bool _isLoadedInMemory = true; - std::vector<lld::AtomLayout *> _atoms; + std::vector<AtomLayout *> _atoms; mutable std::mutex _outputMutex; void printError(const std::string &errorStr, const AtomLayout &atom, @@ -334,7 +334,7 @@ public: std::size_t size() const { return _symbolTable.size(); } void addSymbol(const Atom *atom, int32_t sectionIndex, uint64_t addr = 0, - const lld::AtomLayout *layout = nullptr); + const AtomLayout *layout = nullptr); /// \brief Get the symbol table index for an Atom. If it's not in the symbol /// table, return STN_UNDEF. @@ -375,12 +375,11 @@ public: protected: struct SymbolEntry { - SymbolEntry(const Atom *a, const Elf_Sym &sym, - const lld::AtomLayout *layout) + SymbolEntry(const Atom *a, const Elf_Sym &sym, const AtomLayout *layout) : _atom(a), _atomLayout(layout), _symbol(sym) {} const Atom *_atom; - const lld::AtomLayout *_atomLayout; + const AtomLayout *_atomLayout; Elf_Sym _symbol; }; diff --git a/lld/lib/ReaderWriter/ELF/TargetLayout.cpp b/lld/lib/ReaderWriter/ELF/TargetLayout.cpp index e587bf17a4d..600bd81b725 100644 --- a/lld/lib/ReaderWriter/ELF/TargetLayout.cpp +++ b/lld/lib/ReaderWriter/ELF/TargetLayout.cpp @@ -252,7 +252,7 @@ TargetLayout<ELFT>::getSection(StringRef sectionName, int32_t contentType, } template <class ELFT> -ErrorOr<const lld::AtomLayout *> TargetLayout<ELFT>::addAtom(const Atom *atom) { +ErrorOr<const AtomLayout *> TargetLayout<ELFT>::addAtom(const Atom *atom) { if (const DefinedAtom *definedAtom = dyn_cast<DefinedAtom>(atom)) { // HACK: Ignore undefined atoms. We need to adjust the interface so that // undefined atoms can still be included in the output symbol table for @@ -299,7 +299,7 @@ ErrorOr<const lld::AtomLayout *> TargetLayout<ELFT>::addAtom(const Atom *atom) { // Absolute atoms are not part of any section, they are global for the whole // link _absoluteAtoms.push_back( - new (_allocator) lld::AtomLayout(absoluteAtom, 0, absoluteAtom->value())); + new (_allocator) AtomLayout(absoluteAtom, 0, absoluteAtom->value())); return _absoluteAtoms.back(); } diff --git a/lld/lib/ReaderWriter/ELF/TargetLayout.h b/lld/lib/ReaderWriter/ELF/TargetLayout.h index 578b08f2003..283254fda60 100644 --- a/lld/lib/ReaderWriter/ELF/TargetLayout.h +++ b/lld/lib/ReaderWriter/ELF/TargetLayout.h @@ -148,7 +148,7 @@ public: typedef std::unordered_map<SegmentKey, Segment<ELFT> *, SegmentHashKey> SegmentMapT; - typedef typename std::vector<lld::AtomLayout *>::iterator AbsoluteAtomIterT; + typedef typename std::vector<AtomLayout *>::iterator AbsoluteAtomIterT; typedef llvm::DenseSet<const Atom *> AtomSetT; @@ -187,7 +187,7 @@ public: /// \brief Append the Atom to the layout and create appropriate sections. /// \returns A reference to the atom layout or an error. The atom layout will /// be updated as linking progresses. - virtual ErrorOr<const lld::AtomLayout *> addAtom(const Atom *atom); + virtual ErrorOr<const AtomLayout *> addAtom(const Atom *atom); /// \brief Find an output Section given a section name. OutputSection<ELFT> *findOutputSection(StringRef name) { @@ -198,7 +198,7 @@ public: } /// \brief find a absolute atom given a name - lld::AtomLayout *findAbsoluteAtom(StringRef name) { + AtomLayout *findAbsoluteAtom(StringRef name) { auto iter = std::find_if( _absoluteAtoms.begin(), _absoluteAtoms.end(), [=](const AtomLayout *a) { return a->_atom->name() == name; }); @@ -314,7 +314,7 @@ protected: ProgramHeader<ELFT> *_programHeader; unique_bump_ptr<RelocationTable<ELFT>> _dynamicRelocationTable; unique_bump_ptr<RelocationTable<ELFT>> _pltRelocationTable; - std::vector<lld::AtomLayout *> _absoluteAtoms; + std::vector<AtomLayout *> _absoluteAtoms; AtomSetT _referencedDynAtoms; llvm::StringSet<> _copiedDynSymNames; ELFLinkingContext &_ctx; diff --git a/lld/lib/ReaderWriter/ELF/X86/X86RelocationHandler.cpp b/lld/lib/ReaderWriter/ELF/X86/X86RelocationHandler.cpp index dc950851c26..15774bc3312 100644 --- a/lld/lib/ReaderWriter/ELF/X86/X86RelocationHandler.cpp +++ b/lld/lib/ReaderWriter/ELF/X86/X86RelocationHandler.cpp @@ -30,7 +30,7 @@ static int relocPC32(uint8_t *location, uint64_t P, uint64_t S, uint64_t A) { } std::error_code X86TargetRelocationHandler::applyRelocation( - ELFWriter &writer, llvm::FileOutputBuffer &buf, const lld::AtomLayout &atom, + ELFWriter &writer, llvm::FileOutputBuffer &buf, const AtomLayout &atom, const Reference &ref) const { uint8_t *atomContent = buf.getBufferStart() + atom._fileOffset; uint8_t *loc = atomContent + ref.offsetInAtom(); diff --git a/lld/lib/ReaderWriter/ELF/X86/X86RelocationHandler.h b/lld/lib/ReaderWriter/ELF/X86/X86RelocationHandler.h index b583fe3d80e..1131635c673 100644 --- a/lld/lib/ReaderWriter/ELF/X86/X86RelocationHandler.h +++ b/lld/lib/ReaderWriter/ELF/X86/X86RelocationHandler.h @@ -18,7 +18,7 @@ namespace elf { class X86TargetRelocationHandler final : public TargetRelocationHandler { public: std::error_code applyRelocation(ELFWriter &, llvm::FileOutputBuffer &, - const lld::AtomLayout &, + const AtomLayout &, const Reference &) const override; }; diff --git a/lld/lib/ReaderWriter/ELF/X86_64/X86_64RelocationHandler.cpp b/lld/lib/ReaderWriter/ELF/X86_64/X86_64RelocationHandler.cpp index 8342783a564..b5f64936aae 100644 --- a/lld/lib/ReaderWriter/ELF/X86_64/X86_64RelocationHandler.cpp +++ b/lld/lib/ReaderWriter/ELF/X86_64/X86_64RelocationHandler.cpp @@ -62,7 +62,7 @@ static void relocPC64(uint8_t *location, uint64_t P, uint64_t S, uint64_t A) { } std::error_code X86_64TargetRelocationHandler::applyRelocation( - ELFWriter &writer, llvm::FileOutputBuffer &buf, const lld::AtomLayout &atom, + ELFWriter &writer, llvm::FileOutputBuffer &buf, const AtomLayout &atom, const Reference &ref) const { uint8_t *atomContent = buf.getBufferStart() + atom._fileOffset; uint8_t *loc = atomContent + ref.offsetInAtom(); diff --git a/lld/lib/ReaderWriter/ELF/X86_64/X86_64RelocationHandler.h b/lld/lib/ReaderWriter/ELF/X86_64/X86_64RelocationHandler.h index 7d126e4dd4d..26382804549 100644 --- a/lld/lib/ReaderWriter/ELF/X86_64/X86_64RelocationHandler.h +++ b/lld/lib/ReaderWriter/ELF/X86_64/X86_64RelocationHandler.h @@ -22,7 +22,7 @@ public: : _tlsSize(0), _layout(layout) {} std::error_code applyRelocation(ELFWriter &, llvm::FileOutputBuffer &, - const lld::AtomLayout &, + const AtomLayout &, const Reference &) const override; private: |

