forked from OSchip/llvm-project
parent
3b057b3216
commit
d9cb620330
|
@ -94,10 +94,7 @@ public:
|
|||
/// referenced by the DT_RELA{,ENT,SZ} entries in the dynamic table.
|
||||
/// Relocations that return true will be added to the dynamic relocation
|
||||
/// table.
|
||||
virtual bool isDynamicRelocation(const DefinedAtom &,
|
||||
const Reference &) const {
|
||||
return false;
|
||||
}
|
||||
virtual bool isDynamicRelocation(const Reference &) const { return false; }
|
||||
|
||||
/// \brief Is this a copy relocation?
|
||||
///
|
||||
|
@ -129,9 +126,7 @@ public:
|
|||
/// by the DT_{JMPREL,PLTRELSZ} entries in the dynamic table.
|
||||
/// Relocations that return true will be added to the dynamic plt relocation
|
||||
/// table.
|
||||
virtual bool isPLTRelocation(const DefinedAtom &, const Reference &) const {
|
||||
return false;
|
||||
}
|
||||
virtual bool isPLTRelocation(const Reference &) const { return false; }
|
||||
|
||||
/// \brief The path to the dynamic interpreter
|
||||
virtual StringRef getDefaultInterpreter() const {
|
||||
|
|
|
@ -35,8 +35,7 @@ public:
|
|||
return _baseAddress;
|
||||
}
|
||||
|
||||
bool isDynamicRelocation(const DefinedAtom &,
|
||||
const Reference &r) const override {
|
||||
bool isDynamicRelocation(const Reference &r) const override {
|
||||
if (r.kindNamespace() != Reference::KindNamespace::ELF)
|
||||
return false;
|
||||
assert(r.kindArch() == Reference::KindArch::AArch64);
|
||||
|
@ -64,8 +63,7 @@ public:
|
|||
return false;
|
||||
}
|
||||
|
||||
bool isPLTRelocation(const DefinedAtom &,
|
||||
const Reference &r) const override {
|
||||
bool isPLTRelocation(const Reference &r) const override {
|
||||
if (r.kindNamespace() != Reference::KindNamespace::ELF)
|
||||
return false;
|
||||
assert(r.kindArch() == Reference::KindArch::AArch64);
|
||||
|
|
|
@ -571,10 +571,10 @@ ErrorOr<const lld::AtomLayout &> DefaultLayout<ELFT>::addAtom(const Atom *atom)
|
|||
// Add runtime relocations to the .rela section.
|
||||
for (const auto &reloc : *definedAtom) {
|
||||
bool isLocalReloc = true;
|
||||
if (_context.isDynamicRelocation(*definedAtom, *reloc)) {
|
||||
if (_context.isDynamicRelocation(*reloc)) {
|
||||
getDynamicRelocationTable()->addRelocation(*definedAtom, *reloc);
|
||||
isLocalReloc = false;
|
||||
} else if (_context.isPLTRelocation(*definedAtom, *reloc)) {
|
||||
} else if (_context.isPLTRelocation(*reloc)) {
|
||||
getPLTRelocationTable()->addRelocation(*definedAtom, *reloc);
|
||||
isLocalReloc = false;
|
||||
}
|
||||
|
|
|
@ -26,8 +26,7 @@ public:
|
|||
|
||||
void addPasses(PassManager &) override;
|
||||
|
||||
bool isDynamicRelocation(const DefinedAtom &,
|
||||
const Reference &r) const override {
|
||||
bool isDynamicRelocation(const Reference &r) const override {
|
||||
if (r.kindNamespace() != Reference::KindNamespace::ELF)
|
||||
return false;
|
||||
switch (r.kindValue()) {
|
||||
|
@ -39,7 +38,7 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
bool isPLTRelocation(const DefinedAtom &, const Reference &r) const override {
|
||||
bool isPLTRelocation(const Reference &r) const override {
|
||||
if (r.kindNamespace() != Reference::KindNamespace::ELF)
|
||||
return false;
|
||||
switch (r.kindValue()) {
|
||||
|
|
|
@ -74,8 +74,7 @@ void MipsLinkingContext::addPasses(PassManager &pm) {
|
|||
pm.add(llvm::make_unique<elf::MipsCtorsOrderPass>());
|
||||
}
|
||||
|
||||
bool MipsLinkingContext::isDynamicRelocation(const DefinedAtom &,
|
||||
const Reference &r) const {
|
||||
bool MipsLinkingContext::isDynamicRelocation(const Reference &r) const {
|
||||
if (r.kindNamespace() != Reference::KindNamespace::ELF)
|
||||
return false;
|
||||
assert(r.kindArch() == Reference::KindArch::Mips);
|
||||
|
@ -100,8 +99,7 @@ bool MipsLinkingContext::isCopyRelocation(const Reference &r) const {
|
|||
return false;
|
||||
}
|
||||
|
||||
bool MipsLinkingContext::isPLTRelocation(const DefinedAtom &,
|
||||
const Reference &r) const {
|
||||
bool MipsLinkingContext::isPLTRelocation(const Reference &r) const {
|
||||
if (r.kindNamespace() != Reference::KindNamespace::ELF)
|
||||
return false;
|
||||
assert(r.kindArch() == Reference::KindArch::Mips);
|
||||
|
|
|
@ -50,10 +50,9 @@ public:
|
|||
StringRef getDefaultInterpreter() const override;
|
||||
void addPasses(PassManager &pm) override;
|
||||
bool isRelaOutputFormat() const override { return false; }
|
||||
bool isDynamicRelocation(const DefinedAtom &,
|
||||
const Reference &r) const override;
|
||||
bool isDynamicRelocation(const Reference &r) const override;
|
||||
bool isCopyRelocation(const Reference &r) const override;
|
||||
bool isPLTRelocation(const DefinedAtom &, const Reference &r) const override;
|
||||
bool isPLTRelocation(const Reference &r) const override;
|
||||
|
||||
private:
|
||||
MipsELFFlagsMerger _flagsMerger;
|
||||
|
|
|
@ -37,8 +37,7 @@ public:
|
|||
return _baseAddress;
|
||||
}
|
||||
|
||||
bool isDynamicRelocation(const DefinedAtom &,
|
||||
const Reference &r) const override {
|
||||
bool isDynamicRelocation(const Reference &r) const override {
|
||||
if (r.kindNamespace() != Reference::KindNamespace::ELF)
|
||||
return false;
|
||||
assert(r.kindArch() == Reference::KindArch::x86_64);
|
||||
|
@ -63,8 +62,7 @@ public:
|
|||
return false;
|
||||
}
|
||||
|
||||
virtual bool isPLTRelocation(const DefinedAtom &,
|
||||
const Reference &r) const override {
|
||||
virtual bool isPLTRelocation(const Reference &r) const override {
|
||||
if (r.kindNamespace() != Reference::KindNamespace::ELF)
|
||||
return false;
|
||||
assert(r.kindArch() == Reference::KindArch::x86_64);
|
||||
|
|
Loading…
Reference in New Issue