#include "SymbolTable.h"
#include "COFFLinkerContext.h"
#include "Config.h"
#include "Driver.h"
#include "LTO.h"
#include "PDB.h"
#include "Symbols.h"
#include "lld/Common/ErrorHandler.h"
#include "lld/Common/Memory.h"
#include "lld/Common/Timer.h"
#include "llvm/DebugInfo/DIContext.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/LTO/LTO.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Parallel.h"
#include "llvm/Support/TimeProfiler.h"
#include "llvm/Support/raw_ostream.h"
#include <utility>
usingnamespacellvm;
namespace lld::coff {
StringRef ltrim1(StringRef s, const char *chars) { … }
static bool compatibleMachineType(COFFLinkerContext &ctx, MachineTypes mt) { … }
void SymbolTable::addFile(InputFile *file) { … }
static void errorOrWarn(const Twine &s, bool forceUnresolved) { … }
static void forceLazy(Symbol *s) { … }
static Symbol *getSymbol(SectionChunk *sc, uint32_t addr) { … }
static std::vector<std::string> getSymbolLocations(BitcodeFile *file) { … }
static std::optional<std::pair<StringRef, uint32_t>>
getFileLineDwarf(const SectionChunk *c, uint32_t addr) { … }
static std::optional<std::pair<StringRef, uint32_t>>
getFileLine(const SectionChunk *c, uint32_t addr) { … }
static std::pair<std::vector<std::string>, size_t>
getSymbolLocations(ObjFile *file, uint32_t symIndex, size_t maxStrings) { … }
std::vector<std::string> getSymbolLocations(ObjFile *file, uint32_t symIndex) { … }
static std::pair<std::vector<std::string>, size_t>
getSymbolLocations(InputFile *file, uint32_t symIndex, size_t maxStrings) { … }
struct UndefinedDiag { … };
static void reportUndefinedSymbol(const COFFLinkerContext &ctx,
const UndefinedDiag &undefDiag) { … }
void SymbolTable::loadMinGWSymbols() { … }
Defined *SymbolTable::impSymbol(StringRef name) { … }
bool SymbolTable::handleMinGWAutomaticImport(Symbol *sym, StringRef name) { … }
static void reportProblemSymbols(
const COFFLinkerContext &ctx, const SmallPtrSetImpl<Symbol *> &undefs,
const DenseMap<Symbol *, Symbol *> *localImports, bool needBitcodeFiles) { … }
void SymbolTable::reportUnresolvable() { … }
bool SymbolTable::resolveRemainingUndefines() { … }
std::pair<Symbol *, bool> SymbolTable::insert(StringRef name) { … }
std::pair<Symbol *, bool> SymbolTable::insert(StringRef name, InputFile *file) { … }
void SymbolTable::addEntryThunk(Symbol *from, Symbol *to) { … }
void SymbolTable::addExitThunk(Symbol *from, Symbol *to) { … }
void SymbolTable::initializeECThunks() { … }
Symbol *SymbolTable::addUndefined(StringRef name, InputFile *f,
bool isWeakAlias) { … }
void SymbolTable::addLazyArchive(ArchiveFile *f, const Archive::Symbol &sym) { … }
void SymbolTable::addLazyObject(InputFile *f, StringRef n) { … }
void SymbolTable::addLazyDLLSymbol(DLLFile *f, DLLFile::Symbol *sym,
StringRef n) { … }
static std::string getSourceLocationBitcode(BitcodeFile *file) { … }
static std::string getSourceLocationObj(ObjFile *file, SectionChunk *sc,
uint32_t offset, StringRef name) { … }
static std::string getSourceLocation(InputFile *file, SectionChunk *sc,
uint32_t offset, StringRef name) { … }
void SymbolTable::reportDuplicate(Symbol *existing, InputFile *newFile,
SectionChunk *newSc,
uint32_t newSectionOffset) { … }
Symbol *SymbolTable::addAbsolute(StringRef n, COFFSymbolRef sym) { … }
Symbol *SymbolTable::addAbsolute(StringRef n, uint64_t va) { … }
Symbol *SymbolTable::addSynthetic(StringRef n, Chunk *c) { … }
Symbol *SymbolTable::addRegular(InputFile *f, StringRef n,
const coff_symbol_generic *sym, SectionChunk *c,
uint32_t sectionOffset, bool isWeak) { … }
std::pair<DefinedRegular *, bool>
SymbolTable::addComdat(InputFile *f, StringRef n,
const coff_symbol_generic *sym) { … }
Symbol *SymbolTable::addCommon(InputFile *f, StringRef n, uint64_t size,
const coff_symbol_generic *sym, CommonChunk *c) { … }
DefinedImportData *SymbolTable::addImportData(StringRef n, ImportFile *f,
Chunk *&location) { … }
Defined *SymbolTable::addImportThunk(StringRef name, DefinedImportData *id,
ImportThunkChunk *chunk) { … }
void SymbolTable::addLibcall(StringRef name) { … }
std::vector<Chunk *> SymbolTable::getChunks() const { … }
Symbol *SymbolTable::find(StringRef name) const { … }
Symbol *SymbolTable::findUnderscore(StringRef name) const { … }
std::vector<Symbol *> SymbolTable::getSymsWithPrefix(StringRef prefix) { … }
Symbol *SymbolTable::findMangle(StringRef name) { … }
Symbol *SymbolTable::addUndefined(StringRef name) { … }
void SymbolTable::compileBitcodeFiles() { … }
}