blob: d3f8b0384607a20d09b17bc911f615465f81a037 [file] [log] [blame]
Rui Ueyama411c63602015-05-28 19:09:30 +00001//===- SymbolTable.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
10#include "Config.h"
11#include "Driver.h"
Rui Ueyama8fd9fb92015-06-01 02:58:15 +000012#include "Error.h"
Rui Ueyama411c63602015-05-28 19:09:30 +000013#include "SymbolTable.h"
Chandler Carruthbe6e80b2015-06-29 18:50:11 +000014#include "Symbols.h"
Rui Ueyama411c63602015-05-28 19:09:30 +000015#include "llvm/ADT/STLExtras.h"
Peter Collingbourne60c16162015-06-01 20:10:10 +000016#include "llvm/LTO/LTOCodeGenerator.h"
Rui Ueyama411c63602015-05-28 19:09:30 +000017#include "llvm/Support/Debug.h"
18#include "llvm/Support/raw_ostream.h"
Rui Ueyamaf5313b32015-06-28 22:16:41 +000019#include <utility>
Rui Ueyama411c63602015-05-28 19:09:30 +000020
Rui Ueyamad68ff342015-05-31 03:57:30 +000021using namespace llvm;
22
Rui Ueyama411c63602015-05-28 19:09:30 +000023namespace lld {
24namespace coff {
25
Rui Ueyama8d3010a2015-06-30 19:35:21 +000026void SymbolTable::addFile(std::unique_ptr<InputFile> FileP) {
27 InputFile *File = FileP.get();
28 Files.push_back(std::move(FileP));
29 if (auto *F = dyn_cast<ArchiveFile>(File)) {
30 ArchiveQueue.push_back(F);
31 return;
32 }
33 ObjectQueue.push_back(File);
34 if (auto *F = dyn_cast<ObjectFile>(File)) {
35 ObjectFiles.push_back(F);
36 } else if (auto *F = dyn_cast<BitcodeFile>(File)) {
37 BitcodeFiles.push_back(F);
38 } else {
39 ImportFiles.push_back(cast<ImportFile>(File));
40 }
Rui Ueyama411c63602015-05-28 19:09:30 +000041}
42
Rui Ueyama85225b02015-07-02 03:15:15 +000043std::error_code SymbolTable::step() {
44 if (queueEmpty())
45 return std::error_code();
46 if (auto EC = readObjects())
47 return EC;
48 if (auto EC = readArchives())
49 return EC;
50 return std::error_code();
51}
52
Rui Ueyama0d2e9992015-06-23 23:56:39 +000053std::error_code SymbolTable::run() {
Rui Ueyama85225b02015-07-02 03:15:15 +000054 while (!queueEmpty())
55 if (auto EC = step())
Rui Ueyama0d2e9992015-06-23 23:56:39 +000056 return EC;
Peter Collingbourneace2f092015-06-06 02:00:45 +000057 return std::error_code();
58}
59
Rui Ueyama8d3010a2015-06-30 19:35:21 +000060std::error_code SymbolTable::readArchives() {
61 if (ArchiveQueue.empty())
62 return std::error_code();
63
64 // Add lazy symbols to the symbol table. Lazy symbols that conflict
65 // with existing undefined symbols are accumulated in LazySyms.
66 std::vector<Symbol *> LazySyms;
67 for (ArchiveFile *File : ArchiveQueue) {
68 if (Config->Verbose)
69 llvm::outs() << "Reading " << File->getShortName() << "\n";
70 if (auto EC = File->parse())
71 return EC;
72 for (Lazy *Sym : File->getLazySymbols())
73 addLazy(Sym, &LazySyms);
74 }
75 ArchiveQueue.clear();
76
77 // Add archive member files to ObjectQueue that should resolve
78 // existing undefined symbols.
79 for (Symbol *Sym : LazySyms)
Rui Ueyama183f53f2015-07-06 17:45:22 +000080 if (auto EC = addMemberFile(cast<Lazy>(Sym->Body)))
Rui Ueyama8d3010a2015-06-30 19:35:21 +000081 return EC;
82 return std::error_code();
83}
84
85std::error_code SymbolTable::readObjects() {
86 if (ObjectQueue.empty())
87 return std::error_code();
88
89 // Add defined and undefined symbols to the symbol table.
90 std::vector<StringRef> Directives;
91 for (size_t I = 0; I < ObjectQueue.size(); ++I) {
92 InputFile *File = ObjectQueue[I];
93 if (Config->Verbose)
94 llvm::outs() << "Reading " << File->getShortName() << "\n";
95 if (auto EC = File->parse())
96 return EC;
97 // Adding symbols may add more files to ObjectQueue
98 // (but not to ArchiveQueue).
99 for (SymbolBody *Sym : File->getSymbols())
100 if (Sym->isExternal())
101 if (auto EC = addSymbol(Sym))
102 return EC;
103 StringRef S = File->getDirectives();
Rui Ueyamaa3d463d2015-07-04 01:39:11 +0000104 if (!S.empty()) {
Rui Ueyama8d3010a2015-06-30 19:35:21 +0000105 Directives.push_back(S);
Rui Ueyamaa3d463d2015-07-04 01:39:11 +0000106 if (Config->Verbose)
107 llvm::outs() << "Directives: " << File->getShortName()
108 << ": " << S << "\n";
109 }
Rui Ueyama8d3010a2015-06-30 19:35:21 +0000110 }
111 ObjectQueue.clear();
112
113 // Parse directive sections. This may add files to
114 // ArchiveQueue and ObjectQueue.
115 for (StringRef S : Directives)
116 if (auto EC = Driver->parseDirectives(S))
117 return EC;
118 return std::error_code();
119}
120
Rui Ueyama3d4c69c2015-07-02 02:38:59 +0000121bool SymbolTable::queueEmpty() {
122 return ArchiveQueue.empty() && ObjectQueue.empty();
123}
124
Peter Collingbourne2612a322015-07-04 05:28:41 +0000125bool SymbolTable::reportRemainingUndefines(bool Resolve) {
Peter Collingbournef5339ec2015-07-07 18:38:39 +0000126 llvm::SmallPtrSet<SymbolBody *, 8> Undefs;
Rui Ueyama411c63602015-05-28 19:09:30 +0000127 for (auto &I : Symtab) {
128 Symbol *Sym = I.second;
Rui Ueyama183f53f2015-07-06 17:45:22 +0000129 auto *Undef = dyn_cast<Undefined>(Sym->Body);
Rui Ueyama411c63602015-05-28 19:09:30 +0000130 if (!Undef)
131 continue;
Rui Ueyamad7666532015-06-25 02:21:44 +0000132 StringRef Name = Undef->getName();
Peter Collingbourne2612a322015-07-04 05:28:41 +0000133 // A weak alias may have been resolved, so check for that.
134 if (Defined *D = Undef->getWeakAlias()) {
135 if (Resolve)
Rui Ueyama6bf638e2015-07-02 00:04:14 +0000136 Sym->Body = D;
Peter Collingbourne2612a322015-07-04 05:28:41 +0000137 continue;
Rui Ueyama411c63602015-05-28 19:09:30 +0000138 }
Rui Ueyamad7666532015-06-25 02:21:44 +0000139 // If we can resolve a symbol by removing __imp_ prefix, do that.
140 // This odd rule is for compatibility with MSVC linker.
141 if (Name.startswith("__imp_")) {
Rui Ueyama458d7442015-07-02 03:59:04 +0000142 Symbol *Imp = find(Name.substr(strlen("__imp_")));
Rui Ueyama183f53f2015-07-06 17:45:22 +0000143 if (Imp && isa<Defined>(Imp->Body)) {
Peter Collingbourne2612a322015-07-04 05:28:41 +0000144 if (!Resolve)
145 continue;
Rui Ueyama183f53f2015-07-06 17:45:22 +0000146 auto *D = cast<Defined>(Imp->Body);
Rui Ueyama458d7442015-07-02 03:59:04 +0000147 auto *S = new (Alloc) DefinedLocalImport(Name, D);
Rui Ueyama88e0f922015-06-25 03:31:47 +0000148 LocalImportChunks.push_back(S->getChunk());
149 Sym->Body = S;
Rui Ueyamad7666532015-06-25 02:21:44 +0000150 continue;
151 }
152 }
Rui Ueyama95925fd2015-06-28 19:35:15 +0000153 // Remaining undefined symbols are not fatal if /force is specified.
154 // They are replaced with dummy defined symbols.
Peter Collingbournef5339ec2015-07-07 18:38:39 +0000155 if (Config->Force && Resolve)
156 Sym->Body = new (Alloc) DefinedAbsolute(Name, 0);
157 Undefs.insert(Sym->Body);
Rui Ueyama411c63602015-05-28 19:09:30 +0000158 }
Peter Collingbournef5339ec2015-07-07 18:38:39 +0000159 if (Undefs.empty())
160 return false;
161 for (Undefined *U : Config->GCRoot)
162 if (Undefs.count(U->repl()))
163 llvm::errs() << "<root>: undefined symbol: " << U->getName() << "\n";
164 for (std::unique_ptr<InputFile> &File : Files)
165 if (!isa<ArchiveFile>(File.get()))
166 for (SymbolBody *Sym : File->getSymbols())
167 if (Undefs.count(Sym->repl()))
168 llvm::errs() << File->getShortName() << ": undefined symbol: "
169 << Sym->getName() << "\n";
170 return !Config->Force;
Rui Ueyama411c63602015-05-28 19:09:30 +0000171}
172
Rui Ueyama8d3010a2015-06-30 19:35:21 +0000173void SymbolTable::addLazy(Lazy *New, std::vector<Symbol *> *Accum) {
Rui Ueyama6be90992015-07-02 22:52:33 +0000174 Symbol *Sym = insert(New);
175 if (Sym->Body == New)
Rui Ueyama8d3010a2015-06-30 19:35:21 +0000176 return;
Rui Ueyamae2eb1552015-07-05 22:05:08 +0000177 for (;;) {
178 SymbolBody *Existing = Sym->Body;
179 if (isa<Defined>(Existing))
180 return;
181 if (Lazy *L = dyn_cast<Lazy>(Existing))
182 if (L->getFileIndex() < New->getFileIndex())
183 return;
184 if (!Sym->Body.compare_exchange_strong(Existing, New))
185 continue;
186 New->setBackref(Sym);
Peter Collingbourne8e174512015-07-07 02:15:25 +0000187 if (isa<Undefined>(Existing))
188 Accum->push_back(Sym);
Rui Ueyama8d3010a2015-06-30 19:35:21 +0000189 return;
Rui Ueyamae2eb1552015-07-05 22:05:08 +0000190 }
Rui Ueyama8d3010a2015-06-30 19:35:21 +0000191}
192
193std::error_code SymbolTable::addSymbol(SymbolBody *New) {
194 // Find an existing symbol or create and insert a new one.
195 assert(isa<Defined>(New) || isa<Undefined>(New));
Rui Ueyama6be90992015-07-02 22:52:33 +0000196 Symbol *Sym = insert(New);
197 if (Sym->Body == New)
Rui Ueyama411c63602015-05-28 19:09:30 +0000198 return std::error_code();
Rui Ueyama411c63602015-05-28 19:09:30 +0000199
Rui Ueyamae2eb1552015-07-05 22:05:08 +0000200 for (;;) {
201 SymbolBody *Existing = Sym->Body;
202
203 // If we have an undefined symbol and a lazy symbol,
204 // let the lazy symbol to read a member file.
205 if (auto *L = dyn_cast<Lazy>(Existing)) {
206 // Undefined symbols with weak aliases need not to be resolved,
207 // since they would be replaced with weak aliases if they remain
208 // undefined.
209 if (auto *U = dyn_cast<Undefined>(New))
210 if (!U->WeakAlias)
211 return addMemberFile(L);
212 if (!Sym->Body.compare_exchange_strong(Existing, New))
213 continue;
214 return std::error_code();
215 }
216
217 // compare() returns -1, 0, or 1 if the lhs symbol is less preferable,
218 // equivalent (conflicting), or more preferable, respectively.
219 int Comp = Existing->compare(New);
220 if (Comp == 0) {
221 llvm::errs() << "duplicate symbol: " << Existing->getDebugName()
222 << " and " << New->getDebugName() << "\n";
223 return make_error_code(LLDError::DuplicateSymbols);
224 }
225 if (Comp < 0)
226 if (!Sym->Body.compare_exchange_strong(Existing, New))
227 continue;
Rui Ueyama8d3010a2015-06-30 19:35:21 +0000228 return std::error_code();
229 }
Rui Ueyama411c63602015-05-28 19:09:30 +0000230}
231
Rui Ueyama6be90992015-07-02 22:52:33 +0000232Symbol *SymbolTable::insert(SymbolBody *New) {
233 Symbol *&Sym = Symtab[New->getName()];
234 if (Sym) {
235 New->setBackref(Sym);
236 return Sym;
237 }
238 Sym = new (Alloc) Symbol(New);
239 New->setBackref(Sym);
240 return Sym;
241}
242
Rui Ueyama411c63602015-05-28 19:09:30 +0000243// Reads an archive member file pointed by a given symbol.
244std::error_code SymbolTable::addMemberFile(Lazy *Body) {
245 auto FileOrErr = Body->getMember();
246 if (auto EC = FileOrErr.getError())
247 return EC;
248 std::unique_ptr<InputFile> File = std::move(FileOrErr.get());
249
250 // getMember returns an empty buffer if the member was already
251 // read from the library.
252 if (!File)
253 return std::error_code();
254 if (Config->Verbose)
Rui Ueyama5b2588a2015-06-08 05:43:50 +0000255 llvm::outs() << "Loaded " << File->getShortName() << " for "
Rui Ueyama411c63602015-05-28 19:09:30 +0000256 << Body->getName() << "\n";
Rui Ueyama0d2e9992015-06-23 23:56:39 +0000257 addFile(std::move(File));
258 return std::error_code();
Rui Ueyama411c63602015-05-28 19:09:30 +0000259}
260
261std::vector<Chunk *> SymbolTable::getChunks() {
262 std::vector<Chunk *> Res;
Rui Ueyama0d2e9992015-06-23 23:56:39 +0000263 for (ObjectFile *File : ObjectFiles) {
Rui Ueyama411c63602015-05-28 19:09:30 +0000264 std::vector<Chunk *> &V = File->getChunks();
265 Res.insert(Res.end(), V.begin(), V.end());
266 }
267 return Res;
268}
269
Rui Ueyama458d7442015-07-02 03:59:04 +0000270Symbol *SymbolTable::find(StringRef Name) {
Rui Ueyama45044f42015-06-29 01:03:53 +0000271 auto It = Symtab.find(Name);
272 if (It == Symtab.end())
273 return nullptr;
Rui Ueyama4b669892015-06-30 23:46:52 +0000274 return It->second;
Rui Ueyama45044f42015-06-29 01:03:53 +0000275}
276
Rui Ueyamaa50387f2015-07-14 02:58:13 +0000277StringRef SymbolTable::findByPrefix(StringRef Prefix) {
278 for (auto Pair : Symtab) {
279 StringRef Name = Pair.first;
280 if (Name.startswith(Prefix))
281 return Name;
282 }
283 return "";
284}
285
286StringRef SymbolTable::findMangle(StringRef Name) {
287 if (Symbol *Sym = find(Name))
288 if (!isa<Undefined>(Sym->Body))
289 return Name;
290 if (Config->is64())
291 return findByPrefix(("?" + Name + "@@Y").str());
292 if (!Name.startswith("_"))
293 return "";
294 // Search for x86 C function.
295 StringRef S = findByPrefix((Name + "@").str());
296 if (!S.empty())
297 return S;
298 // Search for x86 C++ non-member function.
299 return findByPrefix(("?" + Name.substr(1) + "@@Y").str());
300}
301
Rui Ueyama6bf638e2015-07-02 00:04:14 +0000302void SymbolTable::mangleMaybe(Undefined *U) {
303 if (U->WeakAlias)
304 return;
Rui Ueyama0744e872015-07-02 00:21:11 +0000305 if (!isa<Undefined>(U->repl()))
Rui Ueyama6bf638e2015-07-02 00:04:14 +0000306 return;
Rui Ueyamaa50387f2015-07-14 02:58:13 +0000307 StringRef Alias = findMangle(U->getName());
308 if (!Alias.empty())
309 U->WeakAlias = addUndefined(Alias);
Rui Ueyamaf5313b32015-06-28 22:16:41 +0000310}
311
Rui Ueyama6bf638e2015-07-02 00:04:14 +0000312Undefined *SymbolTable::addUndefined(StringRef Name) {
Rui Ueyama3d4c69c2015-07-02 02:38:59 +0000313 auto *New = new (Alloc) Undefined(Name);
314 addSymbol(New);
315 if (auto *U = dyn_cast<Undefined>(New->repl()))
316 return U;
317 return New;
Rui Ueyama360bace2015-05-31 22:31:31 +0000318}
319
Rui Ueyamacd3f99b2015-07-24 23:51:14 +0000320DefinedRelative *SymbolTable::addRelative(StringRef Name, uint64_t VA) {
321 auto *New = new (Alloc) DefinedRelative(Name, VA);
322 addSymbol(New);
323 return New;
324}
325
326DefinedAbsolute *SymbolTable::addAbsolute(StringRef Name, uint64_t VA) {
327 auto *New = new (Alloc) DefinedAbsolute(Name, VA);
328 addSymbol(New);
329 return New;
Rui Ueyama49d6cd32015-07-03 00:02:19 +0000330}
331
Peter Collingbournebe549552015-06-26 18:58:24 +0000332void SymbolTable::printMap(llvm::raw_ostream &OS) {
333 for (ObjectFile *File : ObjectFiles) {
334 OS << File->getShortName() << ":\n";
335 for (SymbolBody *Body : File->getSymbols())
336 if (auto *R = dyn_cast<DefinedRegular>(Body))
337 if (R->isLive())
338 OS << Twine::utohexstr(Config->ImageBase + R->getRVA())
339 << " " << R->getName() << "\n";
340 }
341}
342
Peter Collingbourne60c16162015-06-01 20:10:10 +0000343std::error_code SymbolTable::addCombinedLTOObject() {
344 if (BitcodeFiles.empty())
345 return std::error_code();
346
Peter Collingbourne2612a322015-07-04 05:28:41 +0000347 // Diagnose any undefined symbols early, but do not resolve weak externals,
348 // as resolution breaks the invariant that each Symbol points to a unique
349 // SymbolBody, which we rely on to replace DefinedBitcode symbols correctly.
350 if (reportRemainingUndefines(/*Resolve=*/false))
351 return make_error_code(LLDError::BrokenFile);
352
Peter Collingbourne60c16162015-06-01 20:10:10 +0000353 // Create an object file and add it to the symbol table by replacing any
354 // DefinedBitcode symbols with the definitions in the object file.
Rui Ueyamaefba7812015-06-09 17:52:17 +0000355 LTOCodeGenerator CG;
356 auto FileOrErr = createLTOObject(&CG);
357 if (auto EC = FileOrErr.getError())
Peter Collingbourne60c16162015-06-01 20:10:10 +0000358 return EC;
Rui Ueyamaefba7812015-06-09 17:52:17 +0000359 ObjectFile *Obj = FileOrErr.get();
360
Peter Collingbourne60c16162015-06-01 20:10:10 +0000361 for (SymbolBody *Body : Obj->getSymbols()) {
362 if (!Body->isExternal())
363 continue;
Peter Collingbourne2612a322015-07-04 05:28:41 +0000364 // We should not see any new undefined symbols at this point, but we'll
365 // diagnose them later in reportRemainingUndefines().
Peter Collingbourne60c16162015-06-01 20:10:10 +0000366 StringRef Name = Body->getName();
Rui Ueyama6be90992015-07-02 22:52:33 +0000367 Symbol *Sym = insert(Body);
Peter Collingbourne60c16162015-06-01 20:10:10 +0000368
Rui Ueyama183f53f2015-07-06 17:45:22 +0000369 if (isa<DefinedBitcode>(Sym->Body)) {
Peter Collingbourne60c16162015-06-01 20:10:10 +0000370 Sym->Body = Body;
Rui Ueyama8d3010a2015-06-30 19:35:21 +0000371 continue;
Peter Collingbourne60c16162015-06-01 20:10:10 +0000372 }
Rui Ueyama183f53f2015-07-06 17:45:22 +0000373 if (auto *L = dyn_cast<Lazy>(Sym->Body)) {
Rui Ueyama8d3010a2015-06-30 19:35:21 +0000374 // We may see new references to runtime library symbols such as __chkstk
375 // here. These symbols must be wholly defined in non-bitcode files.
376 if (auto EC = addMemberFile(L))
Peter Collingbourne2ed4c8f2015-06-24 00:12:34 +0000377 return EC;
Rui Ueyama8d3010a2015-06-30 19:35:21 +0000378 continue;
379 }
380 SymbolBody *Existing = Sym->Body;
381 int Comp = Existing->compare(Body);
382 if (Comp == 0) {
383 llvm::errs() << "LTO: unexpected duplicate symbol: " << Name << "\n";
384 return make_error_code(LLDError::BrokenFile);
385 }
386 if (Comp < 0)
387 Sym->Body = Body;
Rui Ueyama0d2e9992015-06-23 23:56:39 +0000388 }
389
390 size_t NumBitcodeFiles = BitcodeFiles.size();
391 if (auto EC = run())
392 return EC;
393 if (BitcodeFiles.size() != NumBitcodeFiles) {
394 llvm::errs() << "LTO: late loaded symbol created new bitcode reference\n";
395 return make_error_code(LLDError::BrokenFile);
Peter Collingbourne60c16162015-06-01 20:10:10 +0000396 }
397
398 return std::error_code();
399}
400
Rui Ueyamaefba7812015-06-09 17:52:17 +0000401// Combine and compile bitcode files and then return the result
402// as a regular COFF object file.
403ErrorOr<ObjectFile *> SymbolTable::createLTOObject(LTOCodeGenerator *CG) {
404 // All symbols referenced by non-bitcode objects must be preserved.
Rui Ueyama0d2e9992015-06-23 23:56:39 +0000405 for (ObjectFile *File : ObjectFiles)
Rui Ueyamaefba7812015-06-09 17:52:17 +0000406 for (SymbolBody *Body : File->getSymbols())
Rui Ueyama0744e872015-07-02 00:21:11 +0000407 if (auto *S = dyn_cast<DefinedBitcode>(Body->repl()))
Rui Ueyamaefba7812015-06-09 17:52:17 +0000408 CG->addMustPreserveSymbol(S->getName());
409
Peter Collingbourne1b6fd1f2015-06-11 21:49:54 +0000410 // Likewise for bitcode symbols which we initially resolved to non-bitcode.
Rui Ueyama0d2e9992015-06-23 23:56:39 +0000411 for (BitcodeFile *File : BitcodeFiles)
Peter Collingbourne1b6fd1f2015-06-11 21:49:54 +0000412 for (SymbolBody *Body : File->getSymbols())
Rui Ueyama0744e872015-07-02 00:21:11 +0000413 if (isa<DefinedBitcode>(Body) && !isa<DefinedBitcode>(Body->repl()))
Peter Collingbourne1b6fd1f2015-06-11 21:49:54 +0000414 CG->addMustPreserveSymbol(Body->getName());
415
Rui Ueyamaefba7812015-06-09 17:52:17 +0000416 // Likewise for other symbols that must be preserved.
Peter Collingbourne2612a322015-07-04 05:28:41 +0000417 for (Undefined *U : Config->GCRoot) {
418 if (auto *S = dyn_cast<DefinedBitcode>(U->repl()))
419 CG->addMustPreserveSymbol(S->getName());
420 else if (auto *S = dyn_cast_or_null<DefinedBitcode>(U->getWeakAlias()))
421 CG->addMustPreserveSymbol(S->getName());
422 }
Rui Ueyamaefba7812015-06-09 17:52:17 +0000423
424 CG->setModule(BitcodeFiles[0]->releaseModule());
425 for (unsigned I = 1, E = BitcodeFiles.size(); I != E; ++I)
426 CG->addModule(BitcodeFiles[I]->getModule());
427
428 std::string ErrMsg;
429 LTOMB = CG->compile(false, false, false, ErrMsg); // take MB ownership
430 if (!LTOMB) {
431 llvm::errs() << ErrMsg << '\n';
432 return make_error_code(LLDError::BrokenFile);
433 }
Rui Ueyama0d2e9992015-06-23 23:56:39 +0000434 auto *Obj = new ObjectFile(LTOMB->getMemBufferRef());
435 Files.emplace_back(Obj);
436 ObjectFiles.push_back(Obj);
Rui Ueyamaefba7812015-06-09 17:52:17 +0000437 if (auto EC = Obj->parse())
438 return EC;
439 return Obj;
440}
441
Rui Ueyama411c63602015-05-28 19:09:30 +0000442} // namespace coff
443} // namespace lld