forked from OSchip/llvm-project
ELF: Remove redundant namespace qualifiers.
llvm-svn: 234938
This commit is contained in:
parent
223de262b9
commit
921b8e93bb
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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")) {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -22,7 +22,7 @@ public:
|
|||
: _targetLayout(layout) {}
|
||||
|
||||
std::error_code applyRelocation(ELFWriter &, llvm::FileOutputBuffer &,
|
||||
const lld::AtomLayout &,
|
||||
const AtomLayout &,
|
||||
const Reference &) const override;
|
||||
|
||||
private:
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue