Revert "[lld-link] implement -start-lib and -end-lib"
This reverts commit r370487 as it is causing ASan/MSan failures on
sanitizer-x86_64-linux-fast
llvm-svn: 370550
diff --git a/lld/COFF/Symbols.h b/lld/COFF/Symbols.h
index fd79bd5..78c357a 100644
--- a/lld/COFF/Symbols.h
+++ b/lld/COFF/Symbols.h
@@ -59,8 +59,7 @@
DefinedSyntheticKind,
UndefinedKind,
- LazyArchiveKind,
- LazyObjectKind,
+ LazyKind,
LastDefinedCOFFKind = DefinedCommonKind,
LastDefinedKind = DefinedSyntheticKind,
@@ -80,10 +79,6 @@
// after calling markLive.
bool isLive() const;
- bool isLazy() const {
- return symbolKind == LazyArchiveKind || symbolKind == LazyObjectKind;
- }
-
protected:
friend SymbolTable;
explicit Symbol(Kind k, StringRef n = "")
@@ -261,27 +256,24 @@
// This class represents a symbol defined in an archive file. It is
// created from an archive file header, and it knows how to load an
// object file from an archive to replace itself with a defined
-// symbol. If the resolver finds both Undefined and LazyArchive for
-// the same name, it will ask the LazyArchive to load a file.
-class LazyArchive : public Symbol {
+// symbol. If the resolver finds both Undefined and Lazy for
+// the same name, it will ask the Lazy to load a file.
+class Lazy : public Symbol {
public:
- LazyArchive(ArchiveFile *f, const Archive::Symbol s)
- : Symbol(LazyArchiveKind, s.getName()), file(f), sym(s) {}
+ Lazy(ArchiveFile *f, const Archive::Symbol s)
+ : Symbol(LazyKind, s.getName()), file(f), sym(s) {}
- static bool classof(const Symbol *s) { return s->kind() == LazyArchiveKind; }
+ static bool classof(const Symbol *s) { return s->kind() == LazyKind; }
MemoryBufferRef getMemberBuffer();
ArchiveFile *file;
- const Archive::Symbol sym;
-};
-class LazyObject : public Symbol {
-public:
- LazyObject(LazyObjFile *f, StringRef n)
- : Symbol(LazyObjectKind, n), file(f) {}
- static bool classof(const Symbol *s) { return s->kind() == LazyObjectKind; }
- LazyObjFile *file;
+private:
+ friend SymbolTable;
+
+private:
+ const Archive::Symbol sym;
};
// Undefined symbols.
@@ -389,8 +381,7 @@
return cast<DefinedCommon>(this)->getRVA();
case DefinedRegularKind:
return cast<DefinedRegular>(this)->getRVA();
- case LazyArchiveKind:
- case LazyObjectKind:
+ case LazyKind:
case UndefinedKind:
llvm_unreachable("Cannot get the address for an undefined symbol.");
}
@@ -413,8 +404,7 @@
return cast<DefinedLocalImport>(this)->getChunk();
case DefinedCommonKind:
return cast<DefinedCommon>(this)->getChunk();
- case LazyArchiveKind:
- case LazyObjectKind:
+ case LazyKind:
case UndefinedKind:
llvm_unreachable("Cannot get the chunk of an undefined symbol.");
}
@@ -429,12 +419,11 @@
alignas(DefinedCommon) char b[sizeof(DefinedCommon)];
alignas(DefinedAbsolute) char c[sizeof(DefinedAbsolute)];
alignas(DefinedSynthetic) char d[sizeof(DefinedSynthetic)];
- alignas(LazyArchive) char e[sizeof(LazyArchive)];
+ alignas(Lazy) char e[sizeof(Lazy)];
alignas(Undefined) char f[sizeof(Undefined)];
alignas(DefinedImportData) char g[sizeof(DefinedImportData)];
alignas(DefinedImportThunk) char h[sizeof(DefinedImportThunk)];
alignas(DefinedLocalImport) char i[sizeof(DefinedLocalImport)];
- alignas(LazyObject) char j[sizeof(LazyObject)];
};
template <typename T, typename... ArgT>