summaryrefslogtreecommitdiffstats
path: root/lld/ELF/Symbols.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/ELF/Symbols.cpp')
-rw-r--r--lld/ELF/Symbols.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/lld/ELF/Symbols.cpp b/lld/ELF/Symbols.cpp
index 5ce57386818..e699640f448 100644
--- a/lld/ELF/Symbols.cpp
+++ b/lld/ELF/Symbols.cpp
@@ -78,7 +78,8 @@ static typename ELFT::uint getSymVA(const SymbolBody &Body,
case SymbolBody::UndefinedElfKind:
case SymbolBody::UndefinedBitcodeKind:
return 0;
- case SymbolBody::LazyKind:
+ case SymbolBody::LazyArchiveKind:
+ case SymbolBody::LazyObjectKind:
assert(Body.isUsedInRegularObj() && "lazy symbol reached writer");
return 0;
case SymbolBody::DefinedBitcodeKind:
@@ -301,7 +302,13 @@ DefinedCommon::DefinedCommon(StringRef N, uint64_t Size, uint64_t Alignment,
: Defined(SymbolBody::DefinedCommonKind, N, Binding, StOther, Type),
Alignment(Alignment), Size(Size) {}
-std::unique_ptr<InputFile> Lazy::getMember() {
+std::unique_ptr<InputFile> Lazy::getFile() {
+ if (auto *S = dyn_cast<LazyArchive>(this))
+ return S->getFile();
+ return cast<LazyObject>(this)->getFile();
+}
+
+std::unique_ptr<InputFile> LazyArchive::getFile() {
MemoryBufferRef MBRef = File->getMember(&Sym);
// getMember returns an empty buffer if the member was already
@@ -311,6 +318,10 @@ std::unique_ptr<InputFile> Lazy::getMember() {
return createObjectFile(MBRef, File->getName());
}
+std::unique_ptr<InputFile> LazyObject::getFile() {
+ return createObjectFile(MBRef);
+}
+
// Returns the demangled C++ symbol name for Name.
std::string elf::demangle(StringRef Name) {
#if !defined(HAVE_CXXABI_H)
OpenPOWER on IntegriCloud