forked from OSchip/llvm-project
parent
aafcf758c9
commit
0f7ccc3d92
|
@ -102,14 +102,12 @@ private:
|
|||
void forEachGroup(std::vector<InputSection<ELFT> *> &V, Comparator Eq);
|
||||
|
||||
template <class RelTy>
|
||||
static bool relocationEq(iterator_range<const RelTy *> RA,
|
||||
iterator_range<const RelTy *> RB);
|
||||
static bool relocationEq(ArrayRef<RelTy> RA, ArrayRef<RelTy> RB);
|
||||
|
||||
template <class RelTy>
|
||||
static bool variableEq(const InputSection<ELFT> *A,
|
||||
const InputSection<ELFT> *B,
|
||||
iterator_range<const RelTy *> RA,
|
||||
iterator_range<const RelTy *> RB);
|
||||
const InputSection<ELFT> *B, ArrayRef<RelTy> RA,
|
||||
ArrayRef<RelTy> RB);
|
||||
|
||||
static bool equalsConstant(const InputSection<ELFT> *A,
|
||||
const InputSection<ELFT> *B);
|
||||
|
@ -206,8 +204,7 @@ void ICF<ELFT>::forEachGroup(std::vector<InputSection<ELFT> *> &V,
|
|||
// Compare two lists of relocations.
|
||||
template <class ELFT>
|
||||
template <class RelTy>
|
||||
bool ICF<ELFT>::relocationEq(iterator_range<const RelTy *> RelsA,
|
||||
iterator_range<const RelTy *> RelsB) {
|
||||
bool ICF<ELFT>::relocationEq(ArrayRef<RelTy> RelsA, ArrayRef<RelTy> RelsB) {
|
||||
const RelTy *IA = RelsA.begin();
|
||||
const RelTy *EA = RelsA.end();
|
||||
const RelTy *IB = RelsB.begin();
|
||||
|
@ -252,9 +249,8 @@ bool ICF<ELFT>::equalsConstant(const InputSection<ELFT> *A,
|
|||
template <class ELFT>
|
||||
template <class RelTy>
|
||||
bool ICF<ELFT>::variableEq(const InputSection<ELFT> *A,
|
||||
const InputSection<ELFT> *B,
|
||||
iterator_range<const RelTy *> RelsA,
|
||||
iterator_range<const RelTy *> RelsB) {
|
||||
const InputSection<ELFT> *B, ArrayRef<RelTy> RelsA,
|
||||
ArrayRef<RelTy> RelsB) {
|
||||
const RelTy *IA = RelsA.begin();
|
||||
const RelTy *EA = RelsA.end();
|
||||
const RelTy *IB = RelsB.begin();
|
||||
|
|
|
@ -55,8 +55,8 @@ typename ELFT::SymRange ELFFileBase<ELFT>::getElfSymbols(bool OnlyGlobals) {
|
|||
fatal("invalid sh_info in symbol table");
|
||||
|
||||
if (OnlyGlobals)
|
||||
return make_range(Syms.begin() + FirstNonLocal, Syms.end());
|
||||
return make_range(Syms.begin(), Syms.end());
|
||||
return makeArrayRef(Syms.begin() + FirstNonLocal, Syms.end());
|
||||
return makeArrayRef(Syms.begin(), Syms.end());
|
||||
}
|
||||
|
||||
template <class ELFT>
|
||||
|
|
|
@ -131,8 +131,7 @@ template <class ELFT> uint64_t InputSection<ELFT>::getThunksSize() const {
|
|||
// copy relocations one by one.
|
||||
template <class ELFT>
|
||||
template <class RelTy>
|
||||
void InputSection<ELFT>::copyRelocations(uint8_t *Buf,
|
||||
iterator_range<const RelTy *> Rels) {
|
||||
void InputSection<ELFT>::copyRelocations(uint8_t *Buf, ArrayRef<RelTy> Rels) {
|
||||
InputSectionBase<ELFT> *RelocatedSection = getRelocatedSection();
|
||||
|
||||
for (const RelTy &Rel : Rels) {
|
||||
|
@ -242,7 +241,7 @@ static uintX_t getMipsGotVA(const SymbolBody &Body, uintX_t SymVA,
|
|||
template <class ELFT>
|
||||
template <class RelTy>
|
||||
void InputSectionBase<ELFT>::relocate(uint8_t *Buf, uint8_t *BufEnd,
|
||||
iterator_range<const RelTy *> Rels) {
|
||||
ArrayRef<RelTy> Rels) {
|
||||
size_t Num = Rels.end() - Rels.begin();
|
||||
for (size_t I = 0; I < Num; ++I) {
|
||||
const RelTy &RI = *(Rels.begin() + I);
|
||||
|
|
|
@ -79,8 +79,7 @@ public:
|
|||
InputSectionBase<ELFT> *getRelocTarget(const Elf_Rela &Rel) const;
|
||||
|
||||
template <class RelTy>
|
||||
void relocate(uint8_t *Buf, uint8_t *BufEnd,
|
||||
llvm::iterator_range<const RelTy *> Rels);
|
||||
void relocate(uint8_t *Buf, uint8_t *BufEnd, llvm::ArrayRef<RelTy> Rels);
|
||||
|
||||
private:
|
||||
template <class RelTy>
|
||||
|
@ -181,7 +180,7 @@ public:
|
|||
|
||||
private:
|
||||
template <class RelTy>
|
||||
void copyRelocations(uint8_t *Buf, llvm::iterator_range<const RelTy *> Rels);
|
||||
void copyRelocations(uint8_t *Buf, llvm::ArrayRef<RelTy> Rels);
|
||||
|
||||
// Called by ICF to merge two input sections.
|
||||
void replace(InputSection<ELFT> *Other);
|
||||
|
|
|
@ -1100,7 +1100,7 @@ static typename ELFT::uint readEntryLength(ArrayRef<uint8_t> D) {
|
|||
template <class ELFT>
|
||||
template <class RelTy>
|
||||
void EHOutputSection<ELFT>::addSectionAux(EHInputSection<ELFT> *S,
|
||||
iterator_range<const RelTy *> Rels) {
|
||||
ArrayRef<RelTy> Rels) {
|
||||
const endianness E = ELFT::TargetEndianness;
|
||||
|
||||
S->OutSec = this;
|
||||
|
@ -1175,7 +1175,7 @@ void EHOutputSection<ELFT>::addSection(InputSectionBase<ELFT> *C) {
|
|||
auto *S = cast<EHInputSection<ELFT>>(C);
|
||||
const Elf_Shdr *RelSec = S->RelocSection;
|
||||
if (!RelSec) {
|
||||
addSectionAux(S, make_range<const Elf_Rela *>(nullptr, nullptr));
|
||||
addSectionAux(S, makeArrayRef<Elf_Rela>(nullptr, nullptr));
|
||||
return;
|
||||
}
|
||||
ELFFile<ELFT> &Obj = S->getFile()->getObj();
|
||||
|
|
|
@ -323,8 +323,7 @@ public:
|
|||
void writeTo(uint8_t *Buf) override;
|
||||
|
||||
template <class RelTy>
|
||||
void addSectionAux(EHInputSection<ELFT> *S,
|
||||
llvm::iterator_range<const RelTy *> Rels);
|
||||
void addSectionAux(EHInputSection<ELFT> *S, llvm::ArrayRef<RelTy> Rels);
|
||||
|
||||
void addSection(InputSectionBase<ELFT> *S) override;
|
||||
|
||||
|
|
|
@ -67,8 +67,7 @@ private:
|
|||
bool needsGot();
|
||||
|
||||
template <class RelTy>
|
||||
void scanRelocs(InputSectionBase<ELFT> &C,
|
||||
iterator_range<const RelTy *> Rels);
|
||||
void scanRelocs(InputSectionBase<ELFT> &C, ArrayRef<RelTy> Rels);
|
||||
|
||||
void scanRelocs(InputSection<ELFT> &C);
|
||||
void scanRelocs(InputSectionBase<ELFT> &S, const Elf_Shdr &RelSec);
|
||||
|
@ -92,7 +91,7 @@ private:
|
|||
}
|
||||
template <class RelTy>
|
||||
void scanRelocsForThunks(const elf::ObjectFile<ELFT> &File,
|
||||
iterator_range<const RelTy *> Rels);
|
||||
ArrayRef<RelTy> Rels);
|
||||
|
||||
void ensureBss();
|
||||
void addCommonSymbols(std::vector<DefinedCommon *> &Syms);
|
||||
|
@ -319,7 +318,7 @@ static unsigned handleTlsRelocation(uint32_t Type, SymbolBody &Body,
|
|||
template <class ELFT>
|
||||
template <class RelTy>
|
||||
void Writer<ELFT>::scanRelocsForThunks(const elf::ObjectFile<ELFT> &File,
|
||||
iterator_range<const RelTy *> Rels) {
|
||||
ArrayRef<RelTy> Rels) {
|
||||
for (const RelTy &RI : Rels) {
|
||||
uint32_t Type = RI.getType(Config->Mips64EL);
|
||||
uint32_t SymIndex = RI.getSymbol(Config->Mips64EL);
|
||||
|
@ -347,8 +346,7 @@ void Writer<ELFT>::scanRelocsForThunks(const elf::ObjectFile<ELFT> &File,
|
|||
// space for the extra PT_LOAD even if we end up not using it.
|
||||
template <class ELFT>
|
||||
template <class RelTy>
|
||||
void Writer<ELFT>::scanRelocs(InputSectionBase<ELFT> &C,
|
||||
iterator_range<const RelTy *> Rels) {
|
||||
void Writer<ELFT>::scanRelocs(InputSectionBase<ELFT> &C, ArrayRef<RelTy> Rels) {
|
||||
const elf::ObjectFile<ELFT> &File = *C.getFile();
|
||||
for (auto I = Rels.begin(), E = Rels.end(); I != E; ++I) {
|
||||
const RelTy &RI = *I;
|
||||
|
|
Loading…
Reference in New Issue