Changeset View
Changeset View
Standalone View
Standalone View
head/contrib/llvm/tools/lld/ELF/Driver.cpp
Show First 20 Lines • Show All 1,004 Lines • ▼ Show 20 Lines | template <class ELFT> void LinkerDriver::link(opt::InputArgList &Args) { | ||||
// Handle undefined symbols in DSOs. | // Handle undefined symbols in DSOs. | ||||
Symtab.scanShlibUndefined(); | Symtab.scanShlibUndefined(); | ||||
// Handle the -exclude-libs option. | // Handle the -exclude-libs option. | ||||
if (Args.hasArg(OPT_exclude_libs)) | if (Args.hasArg(OPT_exclude_libs)) | ||||
excludeLibs(Args, Files); | excludeLibs(Args, Files); | ||||
// Create ElfHeader early. We need a dummy section in | |||||
// addReservedSymbols to mark the created symbols as not absolute. | |||||
Out::ElfHeader = make<OutputSection>("", 0, SHF_ALLOC); | |||||
Out::ElfHeader->Size = sizeof(typename ELFT::Ehdr); | |||||
// We need to create some reserved symbols such as _end. Create them. | |||||
if (!Config->Relocatable) | |||||
addReservedSymbols<ELFT>(); | |||||
// Apply version scripts. | // Apply version scripts. | ||||
Symtab.scanVersionScript(); | Symtab.scanVersionScript(); | ||||
// Create wrapped symbols for -wrap option. | // Create wrapped symbols for -wrap option. | ||||
for (auto *Arg : Args.filtered(OPT_wrap)) | for (auto *Arg : Args.filtered(OPT_wrap)) | ||||
Symtab.addSymbolWrap(Arg->getValue()); | Symtab.addSymbolWrap(Arg->getValue()); | ||||
// Create alias symbols for -defsym option. | // Create alias symbols for -defsym option. | ||||
▲ Show 20 Lines • Show All 43 Lines • Show Last 20 Lines |