diff options
Diffstat (limited to 'contrib/llvm-project/lld/MachO/SymbolTable.h')
-rw-r--r-- | contrib/llvm-project/lld/MachO/SymbolTable.h | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/contrib/llvm-project/lld/MachO/SymbolTable.h b/contrib/llvm-project/lld/MachO/SymbolTable.h index 2379008db56d..871687f75eb7 100644 --- a/contrib/llvm-project/lld/MachO/SymbolTable.h +++ b/contrib/llvm-project/lld/MachO/SymbolTable.h @@ -19,20 +19,34 @@ namespace macho { class ArchiveFile; class DylibFile; +class InputFile; class InputSection; +class MachHeaderSection; class Symbol; +/* + * Note that the SymbolTable handles name collisions by calling + * replaceSymbol(), which does an in-place update of the Symbol via `placement + * new`. Therefore, there is no need to update any relocations that hold + * pointers the "old" Symbol -- they will automatically point to the new one. + */ class SymbolTable { public: - Symbol *addDefined(StringRef name, InputSection *isec, uint32_t value); + Symbol *addDefined(StringRef name, InputSection *isec, uint32_t value, + bool isWeakDef, bool isPrivateExtern); - Symbol *addUndefined(StringRef name); + Symbol *addUndefined(StringRef name, bool isWeakRef); - Symbol *addDylib(StringRef name, DylibFile *file); + Symbol *addCommon(StringRef name, InputFile *, uint64_t size, uint32_t align, + bool isPrivateExtern); + + Symbol *addDylib(StringRef name, DylibFile *file, bool isWeakDef, bool isTlv); Symbol *addLazy(StringRef name, ArchiveFile *file, const llvm::object::Archive::Symbol &sym); + Symbol *addDSOHandle(const MachHeaderSection *); + ArrayRef<Symbol *> getSymbols() const { return symVector; } Symbol *find(StringRef name); @@ -42,6 +56,8 @@ private: std::vector<Symbol *> symVector; }; +extern void treatUndefinedSymbol(StringRef symbolName, StringRef fileName); + extern SymbolTable *symtab; } // namespace macho |