1 //===- InputFiles.cpp -----------------------------------------------------===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 #include "InputFiles.h" 10 #include "Config.h" 11 #include "InputChunks.h" 12 #include "InputEvent.h" 13 #include "InputGlobal.h" 14 #include "SymbolTable.h" 15 #include "lld/Common/ErrorHandler.h" 16 #include "lld/Common/Memory.h" 17 #include "lld/Common/Reproduce.h" 18 #include "llvm/Object/Binary.h" 19 #include "llvm/Object/Wasm.h" 20 #include "llvm/Support/TarWriter.h" 21 #include "llvm/Support/raw_ostream.h" 22 23 #define DEBUG_TYPE "lld" 24 25 using namespace llvm; 26 using namespace llvm::object; 27 using namespace llvm::wasm; 28 29 namespace lld { 30 31 // Returns a string in the format of "foo.o" or "foo.a(bar.o)". 32 std::string toString(const wasm::InputFile *file) { 33 if (!file) 34 return "<internal>"; 35 36 if (file->archiveName.empty()) 37 return std::string(file->getName()); 38 39 return (file->archiveName + "(" + file->getName() + ")").str(); 40 } 41 42 namespace wasm { 43 std::unique_ptr<llvm::TarWriter> tar; 44 45 Optional<MemoryBufferRef> readFile(StringRef path) { 46 log("Loading: " + path); 47 48 auto mbOrErr = MemoryBuffer::getFile(path); 49 if (auto ec = mbOrErr.getError()) { 50 error("cannot open " + path + ": " + ec.message()); 51 return None; 52 } 53 std::unique_ptr<MemoryBuffer> &mb = *mbOrErr; 54 MemoryBufferRef mbref = mb->getMemBufferRef(); 55 make<std::unique_ptr<MemoryBuffer>>(std::move(mb)); // take MB ownership 56 57 if (tar) 58 tar->append(relativeToRoot(path), mbref.getBuffer()); 59 return mbref; 60 } 61 62 InputFile *createObjectFile(MemoryBufferRef mb, 63 StringRef archiveName) { 64 file_magic magic = identify_magic(mb.getBuffer()); 65 if (magic == file_magic::wasm_object) { 66 std::unique_ptr<Binary> bin = 67 CHECK(createBinary(mb), mb.getBufferIdentifier()); 68 auto *obj = cast<WasmObjectFile>(bin.get()); 69 if (obj->isSharedObject()) 70 return make<SharedFile>(mb); 71 return make<ObjFile>(mb, archiveName); 72 } 73 74 if (magic == file_magic::bitcode) 75 return make<BitcodeFile>(mb, archiveName); 76 77 fatal("unknown file type: " + mb.getBufferIdentifier()); 78 } 79 80 void ObjFile::dumpInfo() const { 81 log("info for: " + toString(this) + 82 "\n Symbols : " + Twine(symbols.size()) + 83 "\n Function Imports : " + Twine(wasmObj->getNumImportedFunctions()) + 84 "\n Global Imports : " + Twine(wasmObj->getNumImportedGlobals()) + 85 "\n Event Imports : " + Twine(wasmObj->getNumImportedEvents())); 86 } 87 88 // Relocations contain either symbol or type indices. This function takes a 89 // relocation and returns relocated index (i.e. translates from the input 90 // symbol/type space to the output symbol/type space). 91 uint32_t ObjFile::calcNewIndex(const WasmRelocation &reloc) const { 92 if (reloc.Type == R_WASM_TYPE_INDEX_LEB) { 93 assert(typeIsUsed[reloc.Index]); 94 return typeMap[reloc.Index]; 95 } 96 const Symbol *sym = symbols[reloc.Index]; 97 if (auto *ss = dyn_cast<SectionSymbol>(sym)) 98 sym = ss->getOutputSectionSymbol(); 99 return sym->getOutputSymbolIndex(); 100 } 101 102 // Relocations can contain addend for combined sections. This function takes a 103 // relocation and returns updated addend by offset in the output section. 104 uint32_t ObjFile::calcNewAddend(const WasmRelocation &reloc) const { 105 switch (reloc.Type) { 106 case R_WASM_MEMORY_ADDR_LEB: 107 case R_WASM_MEMORY_ADDR_SLEB: 108 case R_WASM_MEMORY_ADDR_REL_SLEB: 109 case R_WASM_MEMORY_ADDR_I32: 110 case R_WASM_FUNCTION_OFFSET_I32: 111 return reloc.Addend; 112 case R_WASM_SECTION_OFFSET_I32: 113 return getSectionSymbol(reloc.Index)->section->outputOffset + reloc.Addend; 114 default: 115 llvm_unreachable("unexpected relocation type"); 116 } 117 } 118 119 // Calculate the value we expect to find at the relocation location. 120 // This is used as a sanity check before applying a relocation to a given 121 // location. It is useful for catching bugs in the compiler and linker. 122 uint32_t ObjFile::calcExpectedValue(const WasmRelocation &reloc) const { 123 switch (reloc.Type) { 124 case R_WASM_TABLE_INDEX_I32: 125 case R_WASM_TABLE_INDEX_SLEB: 126 case R_WASM_TABLE_INDEX_REL_SLEB: { 127 const WasmSymbol &sym = wasmObj->syms()[reloc.Index]; 128 return tableEntries[sym.Info.ElementIndex]; 129 } 130 case R_WASM_MEMORY_ADDR_SLEB: 131 case R_WASM_MEMORY_ADDR_I32: 132 case R_WASM_MEMORY_ADDR_LEB: 133 case R_WASM_MEMORY_ADDR_REL_SLEB: { 134 const WasmSymbol &sym = wasmObj->syms()[reloc.Index]; 135 if (sym.isUndefined()) 136 return 0; 137 const WasmSegment &segment = 138 wasmObj->dataSegments()[sym.Info.DataRef.Segment]; 139 return segment.Data.Offset.Value.Int32 + sym.Info.DataRef.Offset + 140 reloc.Addend; 141 } 142 case R_WASM_FUNCTION_OFFSET_I32: { 143 const WasmSymbol &sym = wasmObj->syms()[reloc.Index]; 144 InputFunction *f = 145 functions[sym.Info.ElementIndex - wasmObj->getNumImportedFunctions()]; 146 return f->getFunctionInputOffset() + f->getFunctionCodeOffset() + 147 reloc.Addend; 148 } 149 case R_WASM_SECTION_OFFSET_I32: 150 return reloc.Addend; 151 case R_WASM_TYPE_INDEX_LEB: 152 return reloc.Index; 153 case R_WASM_FUNCTION_INDEX_LEB: 154 case R_WASM_GLOBAL_INDEX_LEB: 155 case R_WASM_GLOBAL_INDEX_I32: 156 case R_WASM_EVENT_INDEX_LEB: { 157 const WasmSymbol &sym = wasmObj->syms()[reloc.Index]; 158 return sym.Info.ElementIndex; 159 } 160 default: 161 llvm_unreachable("unknown relocation type"); 162 } 163 } 164 165 // Translate from the relocation's index into the final linked output value. 166 uint32_t ObjFile::calcNewValue(const WasmRelocation &reloc) const { 167 const Symbol* sym = nullptr; 168 if (reloc.Type != R_WASM_TYPE_INDEX_LEB) { 169 sym = symbols[reloc.Index]; 170 171 // We can end up with relocations against non-live symbols. For example 172 // in debug sections. We return reloc.Addend because always returning zero 173 // causes the generation of spurious range-list terminators in the 174 // .debug_ranges section. 175 if ((isa<FunctionSymbol>(sym) || isa<DataSymbol>(sym)) && !sym->isLive()) 176 return reloc.Addend; 177 } 178 179 switch (reloc.Type) { 180 case R_WASM_TABLE_INDEX_I32: 181 case R_WASM_TABLE_INDEX_SLEB: 182 case R_WASM_TABLE_INDEX_REL_SLEB: { 183 if (!getFunctionSymbol(reloc.Index)->hasTableIndex()) 184 return 0; 185 uint32_t index = getFunctionSymbol(reloc.Index)->getTableIndex(); 186 if (reloc.Type == R_WASM_TABLE_INDEX_REL_SLEB) 187 index -= config->tableBase; 188 return index; 189 190 } 191 case R_WASM_MEMORY_ADDR_SLEB: 192 case R_WASM_MEMORY_ADDR_I32: 193 case R_WASM_MEMORY_ADDR_LEB: 194 case R_WASM_MEMORY_ADDR_REL_SLEB: 195 if (isa<UndefinedData>(sym) || sym->isUndefWeak()) 196 return 0; 197 return cast<DefinedData>(sym)->getVirtualAddress() + reloc.Addend; 198 case R_WASM_TYPE_INDEX_LEB: 199 return typeMap[reloc.Index]; 200 case R_WASM_FUNCTION_INDEX_LEB: 201 return getFunctionSymbol(reloc.Index)->getFunctionIndex(); 202 case R_WASM_GLOBAL_INDEX_LEB: 203 case R_WASM_GLOBAL_INDEX_I32: 204 if (auto gs = dyn_cast<GlobalSymbol>(sym)) 205 return gs->getGlobalIndex(); 206 return sym->getGOTIndex(); 207 case R_WASM_EVENT_INDEX_LEB: 208 return getEventSymbol(reloc.Index)->getEventIndex(); 209 case R_WASM_FUNCTION_OFFSET_I32: { 210 auto *f = cast<DefinedFunction>(sym); 211 return f->function->outputOffset + f->function->getFunctionCodeOffset() + 212 reloc.Addend; 213 } 214 case R_WASM_SECTION_OFFSET_I32: 215 return getSectionSymbol(reloc.Index)->section->outputOffset + reloc.Addend; 216 default: 217 llvm_unreachable("unknown relocation type"); 218 } 219 } 220 221 template <class T> 222 static void setRelocs(const std::vector<T *> &chunks, 223 const WasmSection *section) { 224 if (!section) 225 return; 226 227 ArrayRef<WasmRelocation> relocs = section->Relocations; 228 assert(llvm::is_sorted( 229 relocs, [](const WasmRelocation &r1, const WasmRelocation &r2) { 230 return r1.Offset < r2.Offset; 231 })); 232 assert(llvm::is_sorted(chunks, [](InputChunk *c1, InputChunk *c2) { 233 return c1->getInputSectionOffset() < c2->getInputSectionOffset(); 234 })); 235 236 auto relocsNext = relocs.begin(); 237 auto relocsEnd = relocs.end(); 238 auto relocLess = [](const WasmRelocation &r, uint32_t val) { 239 return r.Offset < val; 240 }; 241 for (InputChunk *c : chunks) { 242 auto relocsStart = std::lower_bound(relocsNext, relocsEnd, 243 c->getInputSectionOffset(), relocLess); 244 relocsNext = std::lower_bound( 245 relocsStart, relocsEnd, c->getInputSectionOffset() + c->getInputSize(), 246 relocLess); 247 c->setRelocations(ArrayRef<WasmRelocation>(relocsStart, relocsNext)); 248 } 249 } 250 251 void ObjFile::parse(bool ignoreComdats) { 252 // Parse a memory buffer as a wasm file. 253 LLVM_DEBUG(dbgs() << "Parsing object: " << toString(this) << "\n"); 254 std::unique_ptr<Binary> bin = CHECK(createBinary(mb), toString(this)); 255 256 auto *obj = dyn_cast<WasmObjectFile>(bin.get()); 257 if (!obj) 258 fatal(toString(this) + ": not a wasm file"); 259 if (!obj->isRelocatableObject()) 260 fatal(toString(this) + ": not a relocatable wasm file"); 261 262 bin.release(); 263 wasmObj.reset(obj); 264 265 // Build up a map of function indices to table indices for use when 266 // verifying the existing table index relocations 267 uint32_t totalFunctions = 268 wasmObj->getNumImportedFunctions() + wasmObj->functions().size(); 269 tableEntries.resize(totalFunctions); 270 for (const WasmElemSegment &seg : wasmObj->elements()) { 271 if (seg.Offset.Opcode != WASM_OPCODE_I32_CONST) 272 fatal(toString(this) + ": invalid table elements"); 273 uint32_t offset = seg.Offset.Value.Int32; 274 for (uint32_t index = 0; index < seg.Functions.size(); index++) { 275 276 uint32_t functionIndex = seg.Functions[index]; 277 tableEntries[functionIndex] = offset + index; 278 } 279 } 280 281 uint32_t sectionIndex = 0; 282 283 // Bool for each symbol, true if called directly. This allows us to implement 284 // a weaker form of signature checking where undefined functions that are not 285 // called directly (i.e. only address taken) don't have to match the defined 286 // function's signature. We cannot do this for directly called functions 287 // because those signatures are checked at validation times. 288 // See https://bugs.llvm.org/show_bug.cgi?id=40412 289 std::vector<bool> isCalledDirectly(wasmObj->getNumberOfSymbols(), false); 290 for (const SectionRef &sec : wasmObj->sections()) { 291 const WasmSection §ion = wasmObj->getWasmSection(sec); 292 // Wasm objects can have at most one code and one data section. 293 if (section.Type == WASM_SEC_CODE) { 294 assert(!codeSection); 295 codeSection = §ion; 296 } else if (section.Type == WASM_SEC_DATA) { 297 assert(!dataSection); 298 dataSection = §ion; 299 } else if (section.Type == WASM_SEC_CUSTOM) { 300 customSections.emplace_back(make<InputSection>(section, this)); 301 customSections.back()->setRelocations(section.Relocations); 302 customSectionsByIndex[sectionIndex] = customSections.back(); 303 } 304 sectionIndex++; 305 // Scans relocations to determine if a function symbol is called directly. 306 for (const WasmRelocation &reloc : section.Relocations) 307 if (reloc.Type == R_WASM_FUNCTION_INDEX_LEB) 308 isCalledDirectly[reloc.Index] = true; 309 } 310 311 typeMap.resize(getWasmObj()->types().size()); 312 typeIsUsed.resize(getWasmObj()->types().size(), false); 313 314 ArrayRef<StringRef> comdats = wasmObj->linkingData().Comdats; 315 for (StringRef comdat : comdats) { 316 bool isNew = ignoreComdats || symtab->addComdat(comdat); 317 keptComdats.push_back(isNew); 318 } 319 320 // Populate `Segments`. 321 for (const WasmSegment &s : wasmObj->dataSegments()) { 322 auto* seg = make<InputSegment>(s, this); 323 seg->discarded = isExcludedByComdat(seg); 324 segments.emplace_back(seg); 325 } 326 setRelocs(segments, dataSection); 327 328 // Populate `Functions`. 329 ArrayRef<WasmFunction> funcs = wasmObj->functions(); 330 ArrayRef<uint32_t> funcTypes = wasmObj->functionTypes(); 331 ArrayRef<WasmSignature> types = wasmObj->types(); 332 functions.reserve(funcs.size()); 333 334 for (size_t i = 0, e = funcs.size(); i != e; ++i) { 335 auto* func = make<InputFunction>(types[funcTypes[i]], &funcs[i], this); 336 func->discarded = isExcludedByComdat(func); 337 functions.emplace_back(func); 338 } 339 setRelocs(functions, codeSection); 340 341 // Populate `Globals`. 342 for (const WasmGlobal &g : wasmObj->globals()) 343 globals.emplace_back(make<InputGlobal>(g, this)); 344 345 // Populate `Events`. 346 for (const WasmEvent &e : wasmObj->events()) 347 events.emplace_back(make<InputEvent>(types[e.Type.SigIndex], e, this)); 348 349 // Populate `Symbols` based on the symbols in the object. 350 symbols.reserve(wasmObj->getNumberOfSymbols()); 351 for (const SymbolRef &sym : wasmObj->symbols()) { 352 const WasmSymbol &wasmSym = wasmObj->getWasmSymbol(sym.getRawDataRefImpl()); 353 if (wasmSym.isDefined()) { 354 // createDefined may fail if the symbol is comdat excluded in which case 355 // we fall back to creating an undefined symbol 356 if (Symbol *d = createDefined(wasmSym)) { 357 symbols.push_back(d); 358 continue; 359 } 360 } 361 size_t idx = symbols.size(); 362 symbols.push_back(createUndefined(wasmSym, isCalledDirectly[idx])); 363 } 364 } 365 366 bool ObjFile::isExcludedByComdat(InputChunk *chunk) const { 367 uint32_t c = chunk->getComdat(); 368 if (c == UINT32_MAX) 369 return false; 370 return !keptComdats[c]; 371 } 372 373 FunctionSymbol *ObjFile::getFunctionSymbol(uint32_t index) const { 374 return cast<FunctionSymbol>(symbols[index]); 375 } 376 377 GlobalSymbol *ObjFile::getGlobalSymbol(uint32_t index) const { 378 return cast<GlobalSymbol>(symbols[index]); 379 } 380 381 EventSymbol *ObjFile::getEventSymbol(uint32_t index) const { 382 return cast<EventSymbol>(symbols[index]); 383 } 384 385 SectionSymbol *ObjFile::getSectionSymbol(uint32_t index) const { 386 return cast<SectionSymbol>(symbols[index]); 387 } 388 389 DataSymbol *ObjFile::getDataSymbol(uint32_t index) const { 390 return cast<DataSymbol>(symbols[index]); 391 } 392 393 Symbol *ObjFile::createDefined(const WasmSymbol &sym) { 394 StringRef name = sym.Info.Name; 395 uint32_t flags = sym.Info.Flags; 396 397 switch (sym.Info.Kind) { 398 case WASM_SYMBOL_TYPE_FUNCTION: { 399 InputFunction *func = 400 functions[sym.Info.ElementIndex - wasmObj->getNumImportedFunctions()]; 401 if (sym.isBindingLocal()) 402 return make<DefinedFunction>(name, flags, this, func); 403 if (func->discarded) 404 return nullptr; 405 return symtab->addDefinedFunction(name, flags, this, func); 406 } 407 case WASM_SYMBOL_TYPE_DATA: { 408 InputSegment *seg = segments[sym.Info.DataRef.Segment]; 409 uint32_t offset = sym.Info.DataRef.Offset; 410 uint32_t size = sym.Info.DataRef.Size; 411 if (sym.isBindingLocal()) 412 return make<DefinedData>(name, flags, this, seg, offset, size); 413 if (seg->discarded) 414 return nullptr; 415 return symtab->addDefinedData(name, flags, this, seg, offset, size); 416 } 417 case WASM_SYMBOL_TYPE_GLOBAL: { 418 InputGlobal *global = 419 globals[sym.Info.ElementIndex - wasmObj->getNumImportedGlobals()]; 420 if (sym.isBindingLocal()) 421 return make<DefinedGlobal>(name, flags, this, global); 422 return symtab->addDefinedGlobal(name, flags, this, global); 423 } 424 case WASM_SYMBOL_TYPE_SECTION: { 425 InputSection *section = customSectionsByIndex[sym.Info.ElementIndex]; 426 assert(sym.isBindingLocal()); 427 return make<SectionSymbol>(flags, section, this); 428 } 429 case WASM_SYMBOL_TYPE_EVENT: { 430 InputEvent *event = 431 events[sym.Info.ElementIndex - wasmObj->getNumImportedEvents()]; 432 if (sym.isBindingLocal()) 433 return make<DefinedEvent>(name, flags, this, event); 434 return symtab->addDefinedEvent(name, flags, this, event); 435 } 436 } 437 llvm_unreachable("unknown symbol kind"); 438 } 439 440 Symbol *ObjFile::createUndefined(const WasmSymbol &sym, bool isCalledDirectly) { 441 StringRef name = sym.Info.Name; 442 uint32_t flags = sym.Info.Flags | WASM_SYMBOL_UNDEFINED; 443 444 switch (sym.Info.Kind) { 445 case WASM_SYMBOL_TYPE_FUNCTION: 446 if (sym.isBindingLocal()) 447 return make<UndefinedFunction>(name, sym.Info.ImportName, 448 sym.Info.ImportModule, flags, this, 449 sym.Signature, isCalledDirectly); 450 return symtab->addUndefinedFunction(name, sym.Info.ImportName, 451 sym.Info.ImportModule, flags, this, 452 sym.Signature, isCalledDirectly); 453 case WASM_SYMBOL_TYPE_DATA: 454 if (sym.isBindingLocal()) 455 return make<UndefinedData>(name, flags, this); 456 return symtab->addUndefinedData(name, flags, this); 457 case WASM_SYMBOL_TYPE_GLOBAL: 458 if (sym.isBindingLocal()) 459 return make<UndefinedGlobal>(name, sym.Info.ImportName, 460 sym.Info.ImportModule, flags, this, 461 sym.GlobalType); 462 return symtab->addUndefinedGlobal(name, sym.Info.ImportName, 463 sym.Info.ImportModule, flags, this, 464 sym.GlobalType); 465 case WASM_SYMBOL_TYPE_SECTION: 466 llvm_unreachable("section symbols cannot be undefined"); 467 } 468 llvm_unreachable("unknown symbol kind"); 469 } 470 471 void ArchiveFile::parse() { 472 // Parse a MemoryBufferRef as an archive file. 473 LLVM_DEBUG(dbgs() << "Parsing library: " << toString(this) << "\n"); 474 file = CHECK(Archive::create(mb), toString(this)); 475 476 // Read the symbol table to construct Lazy symbols. 477 int count = 0; 478 for (const Archive::Symbol &sym : file->symbols()) { 479 symtab->addLazy(this, &sym); 480 ++count; 481 } 482 LLVM_DEBUG(dbgs() << "Read " << count << " symbols\n"); 483 } 484 485 void ArchiveFile::addMember(const Archive::Symbol *sym) { 486 const Archive::Child &c = 487 CHECK(sym->getMember(), 488 "could not get the member for symbol " + sym->getName()); 489 490 // Don't try to load the same member twice (this can happen when members 491 // mutually reference each other). 492 if (!seen.insert(c.getChildOffset()).second) 493 return; 494 495 LLVM_DEBUG(dbgs() << "loading lazy: " << sym->getName() << "\n"); 496 LLVM_DEBUG(dbgs() << "from archive: " << toString(this) << "\n"); 497 498 MemoryBufferRef mb = 499 CHECK(c.getMemoryBufferRef(), 500 "could not get the buffer for the member defining symbol " + 501 sym->getName()); 502 503 InputFile *obj = createObjectFile(mb, getName()); 504 symtab->addFile(obj); 505 } 506 507 static uint8_t mapVisibility(GlobalValue::VisibilityTypes gvVisibility) { 508 switch (gvVisibility) { 509 case GlobalValue::DefaultVisibility: 510 return WASM_SYMBOL_VISIBILITY_DEFAULT; 511 case GlobalValue::HiddenVisibility: 512 case GlobalValue::ProtectedVisibility: 513 return WASM_SYMBOL_VISIBILITY_HIDDEN; 514 } 515 llvm_unreachable("unknown visibility"); 516 } 517 518 static Symbol *createBitcodeSymbol(const std::vector<bool> &keptComdats, 519 const lto::InputFile::Symbol &objSym, 520 BitcodeFile &f) { 521 StringRef name = saver.save(objSym.getName()); 522 523 uint32_t flags = objSym.isWeak() ? WASM_SYMBOL_BINDING_WEAK : 0; 524 flags |= mapVisibility(objSym.getVisibility()); 525 526 int c = objSym.getComdatIndex(); 527 bool excludedByComdat = c != -1 && !keptComdats[c]; 528 529 if (objSym.isUndefined() || excludedByComdat) { 530 flags |= WASM_SYMBOL_UNDEFINED; 531 if (objSym.isExecutable()) 532 return symtab->addUndefinedFunction(name, None, None, flags, &f, nullptr, 533 true); 534 return symtab->addUndefinedData(name, flags, &f); 535 } 536 537 if (objSym.isExecutable()) 538 return symtab->addDefinedFunction(name, flags, &f, nullptr); 539 return symtab->addDefinedData(name, flags, &f, nullptr, 0, 0); 540 } 541 542 bool BitcodeFile::doneLTO = false; 543 544 void BitcodeFile::parse() { 545 if (doneLTO) { 546 error(toString(mb.getBufferIdentifier()) + 547 ": attempt to add bitcode file after LTO."); 548 return; 549 } 550 551 obj = check(lto::InputFile::create(MemoryBufferRef( 552 mb.getBuffer(), saver.save(archiveName + mb.getBufferIdentifier())))); 553 Triple t(obj->getTargetTriple()); 554 if (t.getArch() != Triple::wasm32) { 555 error(toString(mb.getBufferIdentifier()) + ": machine type must be wasm32"); 556 return; 557 } 558 std::vector<bool> keptComdats; 559 for (StringRef s : obj->getComdatTable()) 560 keptComdats.push_back(symtab->addComdat(s)); 561 562 for (const lto::InputFile::Symbol &objSym : obj->symbols()) 563 symbols.push_back(createBitcodeSymbol(keptComdats, objSym, *this)); 564 } 565 566 } // namespace wasm 567 } // namespace lld 568