forked from OSchip/llvm-project
parent
104e92a630
commit
808f2d3c62
|
@ -977,6 +977,13 @@ MemoryBufferRef LazyObjectFile::getBuffer() {
|
|||
return MB;
|
||||
}
|
||||
|
||||
InputFile *LazyObjectFile::fetch() {
|
||||
MemoryBufferRef MBRef = getBuffer();
|
||||
if (MBRef.getBuffer().empty())
|
||||
return nullptr;
|
||||
return createObjectFile(MBRef);
|
||||
}
|
||||
|
||||
template <class ELFT> void LazyObjectFile::parse() {
|
||||
for (StringRef Sym : getSymbols())
|
||||
Symtab<ELFT>::X->addLazyObject(Sym, *this);
|
||||
|
|
|
@ -227,6 +227,7 @@ public:
|
|||
|
||||
template <class ELFT> void parse();
|
||||
MemoryBufferRef getBuffer();
|
||||
InputFile *fetch();
|
||||
|
||||
private:
|
||||
std::vector<StringRef> getSymbols();
|
||||
|
|
|
@ -540,13 +540,10 @@ void SymbolTable<ELFT>::addLazyObject(StringRef Name, LazyObjectFile &Obj) {
|
|||
return;
|
||||
|
||||
// See comment for addLazyArchive above.
|
||||
if (S->isWeak()) {
|
||||
if (S->isWeak())
|
||||
replaceBody<LazyObject>(S, Name, Obj, S->body()->Type);
|
||||
} else {
|
||||
MemoryBufferRef MBRef = Obj.getBuffer();
|
||||
if (!MBRef.getBuffer().empty())
|
||||
addFile(createObjectFile(MBRef));
|
||||
}
|
||||
else if (InputFile *F = Obj.fetch())
|
||||
addFile(F);
|
||||
}
|
||||
|
||||
// Process undefined (-u) flags by loading lazy symbols named by those flags.
|
||||
|
|
|
@ -327,12 +327,7 @@ InputFile *LazyArchive::fetch() {
|
|||
return createObjectFile(MBInfo.first, file()->getName(), MBInfo.second);
|
||||
}
|
||||
|
||||
InputFile *LazyObject::fetch() {
|
||||
MemoryBufferRef MBRef = file()->getBuffer();
|
||||
if (MBRef.getBuffer().empty())
|
||||
return nullptr;
|
||||
return createObjectFile(MBRef);
|
||||
}
|
||||
InputFile *LazyObject::fetch() { return file()->fetch(); }
|
||||
|
||||
uint8_t Symbol::computeBinding() const {
|
||||
if (Config->Relocatable)
|
||||
|
|
Loading…
Reference in New Issue