blob: fe0a3f5a8b923f42de4e11fc41440b75fb6c437d [file] [log] [blame]
Michael J. Spencer84487f12015-07-24 21:03:07 +00001//===- Driver.cpp ---------------------------------------------------------===//
2//
3// The LLVM Linker
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
Rui Ueyamaafff74e22015-08-05 23:24:46 +000010#include "Driver.h"
Rafael Espindola192e1fa2015-08-06 15:08:23 +000011#include "Config.h"
12#include "Error.h"
Rui Ueyamaafff74e22015-08-05 23:24:46 +000013#include "InputFiles.h"
14#include "SymbolTable.h"
Rui Ueyamaff777682015-10-09 21:12:40 +000015#include "Target.h"
Michael J. Spencer84487f12015-07-24 21:03:07 +000016#include "Writer.h"
17#include "llvm/ADT/STLExtras.h"
Rafael Espindola2e9eac12015-09-11 21:18:56 +000018#include "llvm/ADT/StringExtras.h"
Rui Ueyamaa4672402015-10-11 02:03:03 +000019#include "llvm/Support/raw_ostream.h"
Rui Ueyamacacf9672015-10-11 02:22:31 +000020#include <utility>
Michael J. Spencer84487f12015-07-24 21:03:07 +000021
22using namespace llvm;
Denis Protivensky1ef7b3f2015-10-07 09:13:03 +000023using namespace llvm::ELF;
Rui Ueyama3ce825e2015-10-09 21:07:25 +000024using namespace llvm::object;
Michael J. Spencer84487f12015-07-24 21:03:07 +000025
26using namespace lld;
27using namespace lld::elf2;
28
Rui Ueyama83cd6e02016-01-06 20:11:55 +000029Configuration *elf2::Config;
30LinkerDriver *elf2::Driver;
Rui Ueyamaf5c4aca2015-09-30 17:06:09 +000031
Rui Ueyama64cfffd2016-01-28 18:40:06 +000032bool elf2::link(ArrayRef<const char *> Args) {
33 HasError = false;
Rui Ueyama570752c2015-08-18 09:13:25 +000034 Configuration C;
Rui Ueyama983ed2b2015-10-01 15:23:09 +000035 LinkerDriver D;
Rui Ueyama570752c2015-08-18 09:13:25 +000036 Config = &C;
Rui Ueyama983ed2b2015-10-01 15:23:09 +000037 Driver = &D;
Rui Ueyama3ce825e2015-10-09 21:07:25 +000038 Driver->main(Args.slice(1));
Rui Ueyama64cfffd2016-01-28 18:40:06 +000039 return !HasError;
Michael J. Spencer84487f12015-07-24 21:03:07 +000040}
41
Rui Ueyamacacf9672015-10-11 02:22:31 +000042static std::pair<ELFKind, uint16_t> parseEmulation(StringRef S) {
Rui Ueyamaa561e782015-10-11 19:46:00 +000043 if (S == "elf32btsmip")
44 return {ELF32BEKind, EM_MIPS};
45 if (S == "elf32ltsmip")
46 return {ELF32LEKind, EM_MIPS};
Davide Italiano15414cd2016-01-12 02:58:59 +000047 if (S == "elf32ppc" || S == "elf32ppc_fbsd")
Rui Ueyamaa561e782015-10-11 19:46:00 +000048 return {ELF32BEKind, EM_PPC};
Davide Italiano15414cd2016-01-12 02:58:59 +000049 if (S == "elf64ppc" || S == "elf64ppc_fbsd")
Rui Ueyamaa561e782015-10-11 19:46:00 +000050 return {ELF64BEKind, EM_PPC64};
51 if (S == "elf_i386")
52 return {ELF32LEKind, EM_386};
53 if (S == "elf_x86_64")
54 return {ELF64LEKind, EM_X86_64};
Igor Kudrin2f610d52015-11-20 02:48:53 +000055 if (S == "aarch64linux")
56 return {ELF64LEKind, EM_AARCH64};
Rui Ueyama9aa56862015-11-24 18:55:36 +000057 if (S == "i386pe" || S == "i386pep" || S == "thumb2pe")
Nico Weberf07bd3b2016-02-01 20:03:53 +000058 fatal("Windows targets are not supported on the ELF frontend: " + S);
59 fatal("Unknown emulation: " + S);
Denis Protivensky1ef7b3f2015-10-07 09:13:03 +000060}
61
Rui Ueyama9b093692016-01-06 00:51:35 +000062// Returns slices of MB by parsing MB as an archive file.
63// Each slice consists of a member file in the archive.
64static std::vector<MemoryBufferRef> getArchiveMembers(MemoryBufferRef MB) {
65 ErrorOr<std::unique_ptr<Archive>> FileOrErr = Archive::create(MB);
Rui Ueyama64cfffd2016-01-28 18:40:06 +000066 fatal(FileOrErr, "Failed to parse archive");
Rui Ueyama9b093692016-01-06 00:51:35 +000067 std::unique_ptr<Archive> File = std::move(*FileOrErr);
68
69 std::vector<MemoryBufferRef> V;
70 for (const ErrorOr<Archive::Child> &C : File->children()) {
Rui Ueyama64cfffd2016-01-28 18:40:06 +000071 fatal(C, "Could not get the child of the archive " + File->getFileName());
Rui Ueyama9b093692016-01-06 00:51:35 +000072 ErrorOr<MemoryBufferRef> MbOrErr = C->getMemoryBufferRef();
Rui Ueyama64cfffd2016-01-28 18:40:06 +000073 fatal(MbOrErr, "Could not get the buffer for a child of the archive " +
Rui Ueyama9b093692016-01-06 00:51:35 +000074 File->getFileName());
75 V.push_back(*MbOrErr);
76 }
77 return V;
78}
79
Rui Ueyama983ed2b2015-10-01 15:23:09 +000080// Opens and parses a file. Path has to be resolved already.
81// Newly created memory buffers are owned by this driver.
82void LinkerDriver::addFile(StringRef Path) {
Rui Ueyamaf5c4aca2015-09-30 17:06:09 +000083 using namespace llvm::sys::fs;
Rui Ueyamaa4672402015-10-11 02:03:03 +000084 if (Config->Verbose)
85 llvm::outs() << Path << "\n";
Rui Ueyama983ed2b2015-10-01 15:23:09 +000086 auto MBOrErr = MemoryBuffer::getFile(Path);
Nico Weberf07bd3b2016-02-01 20:03:53 +000087 fatal(MBOrErr, "cannot open " + Path);
Rui Ueyama983ed2b2015-10-01 15:23:09 +000088 std::unique_ptr<MemoryBuffer> &MB = *MBOrErr;
89 MemoryBufferRef MBRef = MB->getMemBufferRef();
90 OwningMBs.push_back(std::move(MB)); // take MB ownership
91
92 switch (identify_magic(MBRef.getBuffer())) {
93 case file_magic::unknown:
Rui Ueyamaa47ee682015-10-11 01:53:04 +000094 readLinkerScript(&Alloc, MBRef);
Rui Ueyama983ed2b2015-10-01 15:23:09 +000095 return;
96 case file_magic::archive:
Rui Ueyama3ce825e2015-10-09 21:07:25 +000097 if (WholeArchive) {
Rui Ueyama9b093692016-01-06 00:51:35 +000098 for (MemoryBufferRef MB : getArchiveMembers(MBRef))
Rui Ueyama533c0302016-01-06 00:09:43 +000099 Files.push_back(createObjectFile(MB));
Rui Ueyama3ce825e2015-10-09 21:07:25 +0000100 return;
101 }
102 Files.push_back(make_unique<ArchiveFile>(MBRef));
Rui Ueyama983ed2b2015-10-01 15:23:09 +0000103 return;
Rafael Espindolaaf707642015-10-12 01:55:32 +0000104 case file_magic::elf_shared_object:
Rui Ueyama533c0302016-01-06 00:09:43 +0000105 Files.push_back(createSharedFile(MBRef));
Rui Ueyama983ed2b2015-10-01 15:23:09 +0000106 return;
107 default:
Rui Ueyama533c0302016-01-06 00:09:43 +0000108 Files.push_back(createObjectFile(MBRef));
Rui Ueyama983ed2b2015-10-01 15:23:09 +0000109 }
Rui Ueyamaf5c4aca2015-09-30 17:06:09 +0000110}
111
Rui Ueyamad32c63d2016-01-07 17:33:25 +0000112// Some command line options or some combinations of them are not allowed.
113// This function checks for such errors.
114static void checkOptions(opt::InputArgList &Args) {
115 // Traditional linkers can generate re-linkable object files instead
116 // of executables or DSOs. We don't support that since the feature
117 // does not seem to provide more value than the static archiver.
118 if (Args.hasArg(OPT_relocatable))
Nico Weberf07bd3b2016-02-01 20:03:53 +0000119 fatal("-r option is not supported. Use 'ar' command instead.");
Rui Ueyamad32c63d2016-01-07 17:33:25 +0000120
121 // The MIPS ABI as of 2016 does not support the GNU-style symbol lookup
122 // table which is a relatively new feature.
123 if (Config->EMachine == EM_MIPS && Config->GnuHash)
Nico Weberf07bd3b2016-02-01 20:03:53 +0000124 fatal("The .gnu.hash section is not compatible with the MIPS target.");
Rui Ueyamad32c63d2016-01-07 17:33:25 +0000125
126 if (Config->EMachine == EM_AMDGPU && !Config->Entry.empty())
Nico Weberf07bd3b2016-02-01 20:03:53 +0000127 fatal("-e option is not valid for AMDGPU.");
Rui Ueyamad32c63d2016-01-07 17:33:25 +0000128}
129
Rui Ueyama2cac5842015-10-07 19:34:51 +0000130static StringRef
131getString(opt::InputArgList &Args, unsigned Key, StringRef Default = "") {
132 if (auto *Arg = Args.getLastArg(Key))
133 return Arg->getValue();
134 return Default;
135}
136
Rui Ueyama1a8fffa2015-11-12 19:00:37 +0000137static bool hasZOption(opt::InputArgList &Args, StringRef Key) {
138 for (auto *Arg : Args.filtered(OPT_z))
139 if (Key == Arg->getValue())
140 return true;
141 return false;
142}
143
Rui Ueyama3ce825e2015-10-09 21:07:25 +0000144void LinkerDriver::main(ArrayRef<const char *> ArgsArr) {
Rui Ueyama9aa56862015-11-24 18:55:36 +0000145 initSymbols();
Rui Ueyama9ea49c72015-10-07 23:46:11 +0000146
Rui Ueyamac6e1b972015-10-11 18:19:01 +0000147 opt::InputArgList Args = parseArgs(&Alloc, ArgsArr);
Rui Ueyama0dd684c2016-01-07 17:54:19 +0000148 readConfigs(Args);
Rui Ueyama3ce825e2015-10-09 21:07:25 +0000149 createFiles(Args);
Rui Ueyamad32c63d2016-01-07 17:33:25 +0000150 checkOptions(Args);
Rui Ueyamaf5bcf2a2015-11-12 18:54:15 +0000151
Rui Ueyamae717a712015-10-13 16:20:50 +0000152 switch (Config->EKind) {
Rui Ueyama3ce825e2015-10-09 21:07:25 +0000153 case ELF32LEKind:
154 link<ELF32LE>(Args);
155 return;
156 case ELF32BEKind:
157 link<ELF32BE>(Args);
158 return;
159 case ELF64LEKind:
160 link<ELF64LE>(Args);
161 return;
162 case ELF64BEKind:
163 link<ELF64BE>(Args);
164 return;
165 default:
Nico Weberf07bd3b2016-02-01 20:03:53 +0000166 fatal("-m or at least a .o file required");
Rui Ueyama3ce825e2015-10-09 21:07:25 +0000167 }
168}
169
Rui Ueyama0dd684c2016-01-07 17:54:19 +0000170// Initializes Config members by the command line options.
171void LinkerDriver::readConfigs(opt::InputArgList &Args) {
Rui Ueyama2cac5842015-10-07 19:34:51 +0000172 for (auto *Arg : Args.filtered(OPT_L))
Rui Ueyama52a15092015-10-11 03:28:42 +0000173 Config->SearchPaths.push_back(Arg->getValue());
Igor Kudrin1309fc02015-09-28 15:01:59 +0000174
Rafael Espindola2e9eac12015-09-11 21:18:56 +0000175 std::vector<StringRef> RPaths;
176 for (auto *Arg : Args.filtered(OPT_rpath))
177 RPaths.push_back(Arg->getValue());
178 if (!RPaths.empty())
179 Config->RPath = llvm::join(RPaths.begin(), RPaths.end(), ":");
180
Rui Ueyama9aa56862015-11-24 18:55:36 +0000181 if (auto *Arg = Args.getLastArg(OPT_m)) {
Rui Ueyama94b08e32016-01-12 01:33:23 +0000182 // Parse ELF{32,64}{LE,BE} and CPU type.
Rui Ueyama9aa56862015-11-24 18:55:36 +0000183 StringRef S = Arg->getValue();
Rui Ueyama94b08e32016-01-12 01:33:23 +0000184 std::tie(Config->EKind, Config->EMachine) = parseEmulation(S);
Rui Ueyama9aa56862015-11-24 18:55:36 +0000185 Config->Emulation = S;
186 }
187
Rui Ueyamad7c417c2015-09-29 22:33:18 +0000188 Config->AllowMultipleDefinition = Args.hasArg(OPT_allow_multiple_definition);
Davide Italianocebb4492015-10-13 21:02:34 +0000189 Config->Bsymbolic = Args.hasArg(OPT_Bsymbolic);
Rui Ueyamaa4a628f2016-01-13 18:55:39 +0000190 Config->Demangle = !Args.hasArg(OPT_no_demangle);
Rui Ueyamad7c417c2015-09-29 22:33:18 +0000191 Config->DiscardAll = Args.hasArg(OPT_discard_all);
192 Config->DiscardLocals = Args.hasArg(OPT_discard_locals);
193 Config->DiscardNone = Args.hasArg(OPT_discard_none);
George Rimarf6bc65a2016-01-15 13:34:52 +0000194 Config->EhFrameHdr = Args.hasArg(OPT_eh_frame_hdr);
Davide Italianoc39c75d2015-10-06 16:20:00 +0000195 Config->EnableNewDtags = !Args.hasArg(OPT_disable_new_dtags);
Rui Ueyamad7c417c2015-09-29 22:33:18 +0000196 Config->ExportDynamic = Args.hasArg(OPT_export_dynamic);
Rui Ueyamac4aaed92015-10-22 18:49:53 +0000197 Config->GcSections = Args.hasArg(OPT_gc_sections);
Rui Ueyamad7c417c2015-09-29 22:33:18 +0000198 Config->NoInhibitExec = Args.hasArg(OPT_noinhibit_exec);
George Rimar57e40de2015-10-01 20:14:45 +0000199 Config->NoUndefined = Args.hasArg(OPT_no_undefined);
George Rimara5fbebc2015-12-10 09:12:18 +0000200 Config->PrintGcSections = Args.hasArg(OPT_print_gc_sections);
Rui Ueyamad7c417c2015-09-29 22:33:18 +0000201 Config->Shared = Args.hasArg(OPT_shared);
George Rimar5dad7c12015-10-24 08:52:46 +0000202 Config->StripAll = Args.hasArg(OPT_strip_all);
Rui Ueyamaa4672402015-10-11 02:03:03 +0000203 Config->Verbose = Args.hasArg(OPT_verbose);
Rui Ueyamad7c417c2015-09-29 22:33:18 +0000204
Rui Ueyama2cac5842015-10-07 19:34:51 +0000205 Config->DynamicLinker = getString(Args, OPT_dynamic_linker);
206 Config->Entry = getString(Args, OPT_entry);
207 Config->Fini = getString(Args, OPT_fini, "_fini");
208 Config->Init = getString(Args, OPT_init, "_init");
Rui Ueyama964ffb32015-10-09 00:33:44 +0000209 Config->OutputFile = getString(Args, OPT_o);
Rui Ueyama2cac5842015-10-07 19:34:51 +0000210 Config->SoName = getString(Args, OPT_soname);
211 Config->Sysroot = getString(Args, OPT_sysroot);
212
Rui Ueyama7b19c342015-11-24 18:48:16 +0000213 Config->ZExecStack = hasZOption(Args, "execstack");
Rui Ueyama1a8fffa2015-11-12 19:00:37 +0000214 Config->ZNodelete = hasZOption(Args, "nodelete");
215 Config->ZNow = hasZOption(Args, "now");
216 Config->ZOrigin = hasZOption(Args, "origin");
George Rimare3336c02015-11-24 10:15:50 +0000217 Config->ZRelro = !hasZOption(Args, "norelro");
Rui Ueyama1a8fffa2015-11-12 19:00:37 +0000218
Rafael Espindola2c1217d2015-10-23 19:02:19 +0000219 if (auto *Arg = Args.getLastArg(OPT_O)) {
220 StringRef Val = Arg->getValue();
221 if (Val.getAsInteger(10, Config->Optimize))
Nico Weberf07bd3b2016-02-01 20:03:53 +0000222 fatal("Invalid optimization level");
Rafael Espindola2c1217d2015-10-23 19:02:19 +0000223 }
224
Igor Kudrin1b0d7062015-10-22 08:21:35 +0000225 if (auto *Arg = Args.getLastArg(OPT_hash_style)) {
226 StringRef S = Arg->getValue();
227 if (S == "gnu") {
228 Config->GnuHash = true;
229 Config->SysvHash = false;
230 } else if (S == "both") {
231 Config->GnuHash = true;
232 } else if (S != "sysv")
Nico Weberf07bd3b2016-02-01 20:03:53 +0000233 fatal("Unknown hash style: " + S);
Igor Kudrin1b0d7062015-10-22 08:21:35 +0000234 }
235
George Rimar83f406c2015-10-19 17:35:12 +0000236 for (auto *Arg : Args.filtered(OPT_undefined))
237 Config->Undefined.push_back(Arg->getValue());
Rui Ueyama0dd684c2016-01-07 17:54:19 +0000238}
George Rimar83f406c2015-10-19 17:35:12 +0000239
Rui Ueyama0dd684c2016-01-07 17:54:19 +0000240void LinkerDriver::createFiles(opt::InputArgList &Args) {
Igor Kudrind912ee92015-10-01 16:42:03 +0000241 for (auto *Arg : Args) {
242 switch (Arg->getOption().getID()) {
243 case OPT_l:
Nico Weberf07bd3b2016-02-01 20:03:53 +0000244 addFile(searchLibrary(Arg->getValue()));
Igor Kudrind912ee92015-10-01 16:42:03 +0000245 break;
246 case OPT_INPUT:
Davide Italiano4e47d582015-10-11 03:53:36 +0000247 case OPT_script:
Igor Kudrind912ee92015-10-01 16:42:03 +0000248 addFile(Arg->getValue());
249 break;
Rui Ueyama35da9b62015-10-11 20:59:12 +0000250 case OPT_as_needed:
251 Config->AsNeeded = true;
252 break;
253 case OPT_no_as_needed:
254 Config->AsNeeded = false;
255 break;
Igor Kudrind912ee92015-10-01 16:42:03 +0000256 case OPT_Bstatic:
257 Config->Static = true;
258 break;
259 case OPT_Bdynamic:
260 Config->Static = false;
261 break;
Igor Kudrin2696bbe2015-10-01 18:02:21 +0000262 case OPT_whole_archive:
Rui Ueyama3ce825e2015-10-09 21:07:25 +0000263 WholeArchive = true;
Igor Kudrin2696bbe2015-10-01 18:02:21 +0000264 break;
265 case OPT_no_whole_archive:
Rui Ueyama3ce825e2015-10-09 21:07:25 +0000266 WholeArchive = false;
Igor Kudrin2696bbe2015-10-01 18:02:21 +0000267 break;
Rui Ueyamaf5c4aca2015-09-30 17:06:09 +0000268 }
Michael J. Spencer84487f12015-07-24 21:03:07 +0000269 }
270
Nico Weberf07bd3b2016-02-01 20:03:53 +0000271 if (Files.empty())
272 fatal("no input files.");
Rui Ueyama3ce825e2015-10-09 21:07:25 +0000273}
274
275template <class ELFT> void LinkerDriver::link(opt::InputArgList &Args) {
276 SymbolTable<ELFT> Symtab;
Rui Ueyamaff777682015-10-09 21:12:40 +0000277 Target.reset(createTarget());
278
279 if (!Config->Shared) {
280 // Add entry symbol.
Tom Stellard80efb162016-01-07 03:59:08 +0000281 //
282 // There is no entry symbol for AMDGPU binaries, so skip adding one to avoid
283 // having and undefined symbol.
284 if (Config->Entry.empty() && Config->EMachine != EM_AMDGPU)
Rui Ueyama0cef6892015-10-12 15:23:54 +0000285 Config->Entry = (Config->EMachine == EM_MIPS) ? "__start" : "_start";
Rui Ueyama2b675072015-10-14 22:20:57 +0000286
Rui Ueyamaff777682015-10-09 21:12:40 +0000287 // In the assembly for 32 bit x86 the _GLOBAL_OFFSET_TABLE_ symbol
288 // is magical and is used to produce a R_386_GOTPC relocation.
289 // The R_386_GOTPC relocation value doesn't actually depend on the
290 // symbol value, so it could use an index of STN_UNDEF which, according
291 // to the spec, means the symbol value is 0.
292 // Unfortunately both gas and MC keep the _GLOBAL_OFFSET_TABLE_ symbol in
293 // the object file.
294 // The situation is even stranger on x86_64 where the assembly doesn't
295 // need the magical symbol, but gas still puts _GLOBAL_OFFSET_TABLE_ as
296 // an undefined symbol in the .o files.
297 // Given that the symbol is effectively unused, we just create a dummy
298 // hidden one to avoid the undefined symbol error.
Rui Ueyamadd7d9982015-12-16 22:31:14 +0000299 Symtab.addIgnored("_GLOBAL_OFFSET_TABLE_");
Rui Ueyamaff777682015-10-09 21:12:40 +0000300 }
Rui Ueyama3ce825e2015-10-09 21:07:25 +0000301
Ed Mastef2ac6882015-12-11 17:46:46 +0000302 if (!Config->Entry.empty()) {
303 // Set either EntryAddr (if S is a number) or EntrySym (otherwise).
304 StringRef S = Config->Entry;
305 if (S.getAsInteger(0, Config->EntryAddr))
306 Config->EntrySym = Symtab.addUndefined(S);
307 }
308
Rui Ueyama27161302015-12-16 21:35:39 +0000309 if (Config->EMachine == EM_MIPS) {
310 // On MIPS O32 ABI, _gp_disp is a magic symbol designates offset between
Simon Atanasyan188558e2016-01-12 06:23:57 +0000311 // start of function and gp pointer into GOT. Use 'strong' variant of
312 // the addIgnored to prevent '_gp_disp' substitution.
Rafael Espindola3a6a0a02016-01-19 00:05:54 +0000313 Config->MipsGpDisp = Symtab.addIgnored("_gp_disp");
Rui Ueyama27161302015-12-16 21:35:39 +0000314
315 // Define _gp for MIPS. st_value of _gp symbol will be updated by Writer
316 // so that it points to an absolute address which is relative to GOT.
317 // See "Global Data Symbols" in Chapter 6 in the following document:
318 // ftp://www.linux-mips.org/pub/linux/mips/doc/ABI/mipsabi.pdf
Rui Ueyamaa246e0942015-12-25 06:12:18 +0000319 Symtab.addAbsolute("_gp", ElfSym<ELFT>::MipsGp);
Rui Ueyama27161302015-12-16 21:35:39 +0000320 }
Igor Kudrin15cd9ff2015-11-06 07:43:03 +0000321
Rui Ueyama3ce825e2015-10-09 21:07:25 +0000322 for (std::unique_ptr<InputFile> &F : Files)
323 Symtab.addFile(std::move(F));
Rui Ueyama16ba6692016-01-29 19:41:13 +0000324 if (HasError)
325 return; // There were duplicate symbols or incompatible files
Rui Ueyama3ce825e2015-10-09 21:07:25 +0000326
Rui Ueyamaf215dac2015-10-19 20:55:28 +0000327 for (StringRef S : Config->Undefined)
328 Symtab.addUndefinedOpt(S);
Denis Protivensky22220d52015-10-05 09:43:57 +0000329
Rui Ueyamadeb15402016-01-07 17:20:07 +0000330 for (auto *Arg : Args.filtered(OPT_wrap))
331 Symtab.wrap(Arg->getValue());
332
Rui Ueyamaee592822015-10-07 00:25:09 +0000333 if (Config->OutputFile.empty())
334 Config->OutputFile = "a.out";
335
Rui Ueyama75230392015-10-07 18:29:51 +0000336 // Write the result to the file.
Rui Ueyama93bfee52015-10-13 18:10:33 +0000337 Symtab.scanShlibUndefined();
Rui Ueyamac4aaed92015-10-22 18:49:53 +0000338 if (Config->GcSections)
339 markLive<ELFT>(&Symtab);
Rui Ueyama3ce825e2015-10-09 21:07:25 +0000340 writeResult<ELFT>(&Symtab);
Michael J. Spencer84487f12015-07-24 21:03:07 +0000341}