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_EVENT_INDEX_LEB: { 156 const WasmSymbol &sym = wasmObj->syms()[reloc.Index]; 157 return sym.Info.ElementIndex; 158 } 159 default: 160 llvm_unreachable("unknown relocation type"); 161 } 162 } 163 164 // Translate from the relocation's index into the final linked output value. 165 uint32_t ObjFile::calcNewValue(const WasmRelocation &reloc) const { 166 const Symbol* sym = nullptr; 167 if (reloc.Type != R_WASM_TYPE_INDEX_LEB) { 168 sym = symbols[reloc.Index]; 169 170 // We can end up with relocations against non-live symbols. For example 171 // in debug sections. We return reloc.Addend because always returning zero 172 // causes the generation of spurious range-list terminators in the 173 // .debug_ranges section. 174 if ((isa<FunctionSymbol>(sym) || isa<DataSymbol>(sym)) && !sym->isLive()) 175 return reloc.Addend; 176 } 177 178 switch (reloc.Type) { 179 case R_WASM_TABLE_INDEX_I32: 180 case R_WASM_TABLE_INDEX_SLEB: 181 case R_WASM_TABLE_INDEX_REL_SLEB: { 182 if (!getFunctionSymbol(reloc.Index)->hasTableIndex()) 183 return 0; 184 uint32_t index = getFunctionSymbol(reloc.Index)->getTableIndex(); 185 if (reloc.Type == R_WASM_TABLE_INDEX_REL_SLEB) 186 index -= config->tableBase; 187 return index; 188 189 } 190 case R_WASM_MEMORY_ADDR_SLEB: 191 case R_WASM_MEMORY_ADDR_I32: 192 case R_WASM_MEMORY_ADDR_LEB: 193 case R_WASM_MEMORY_ADDR_REL_SLEB: 194 if (isa<UndefinedData>(sym) || sym->isUndefWeak()) 195 return 0; 196 return cast<DefinedData>(sym)->getVirtualAddress() + reloc.Addend; 197 case R_WASM_TYPE_INDEX_LEB: 198 return typeMap[reloc.Index]; 199 case R_WASM_FUNCTION_INDEX_LEB: 200 return getFunctionSymbol(reloc.Index)->getFunctionIndex(); 201 case R_WASM_GLOBAL_INDEX_LEB: 202 if (auto gs = dyn_cast<GlobalSymbol>(sym)) 203 return gs->getGlobalIndex(); 204 return sym->getGOTIndex(); 205 case R_WASM_EVENT_INDEX_LEB: 206 return getEventSymbol(reloc.Index)->getEventIndex(); 207 case R_WASM_FUNCTION_OFFSET_I32: { 208 auto *f = cast<DefinedFunction>(sym); 209 return f->function->outputOffset + f->function->getFunctionCodeOffset() + 210 reloc.Addend; 211 } 212 case R_WASM_SECTION_OFFSET_I32: 213 return getSectionSymbol(reloc.Index)->section->outputOffset + reloc.Addend; 214 default: 215 llvm_unreachable("unknown relocation type"); 216 } 217 } 218 219 template <class T> 220 static void setRelocs(const std::vector<T *> &chunks, 221 const WasmSection *section) { 222 if (!section) 223 return; 224 225 ArrayRef<WasmRelocation> relocs = section->Relocations; 226 assert(std::is_sorted(relocs.begin(), relocs.end(), 227 [](const WasmRelocation &r1, const WasmRelocation &r2) { 228 return r1.Offset < r2.Offset; 229 })); 230 assert(std::is_sorted( 231 chunks.begin(), chunks.end(), [](InputChunk *c1, InputChunk *c2) { 232 return c1->getInputSectionOffset() < c2->getInputSectionOffset(); 233 })); 234 235 auto relocsNext = relocs.begin(); 236 auto relocsEnd = relocs.end(); 237 auto relocLess = [](const WasmRelocation &r, uint32_t val) { 238 return r.Offset < val; 239 }; 240 for (InputChunk *c : chunks) { 241 auto relocsStart = std::lower_bound(relocsNext, relocsEnd, 242 c->getInputSectionOffset(), relocLess); 243 relocsNext = std::lower_bound( 244 relocsStart, relocsEnd, c->getInputSectionOffset() + c->getInputSize(), 245 relocLess); 246 c->setRelocations(ArrayRef<WasmRelocation>(relocsStart, relocsNext)); 247 } 248 } 249 250 void ObjFile::parse(bool ignoreComdats) { 251 // Parse a memory buffer as a wasm file. 252 LLVM_DEBUG(dbgs() << "Parsing object: " << toString(this) << "\n"); 253 std::unique_ptr<Binary> bin = CHECK(createBinary(mb), toString(this)); 254 255 auto *obj = dyn_cast<WasmObjectFile>(bin.get()); 256 if (!obj) 257 fatal(toString(this) + ": not a wasm file"); 258 if (!obj->isRelocatableObject()) 259 fatal(toString(this) + ": not a relocatable wasm file"); 260 261 bin.release(); 262 wasmObj.reset(obj); 263 264 // Build up a map of function indices to table indices for use when 265 // verifying the existing table index relocations 266 uint32_t totalFunctions = 267 wasmObj->getNumImportedFunctions() + wasmObj->functions().size(); 268 tableEntries.resize(totalFunctions); 269 for (const WasmElemSegment &seg : wasmObj->elements()) { 270 if (seg.Offset.Opcode != WASM_OPCODE_I32_CONST) 271 fatal(toString(this) + ": invalid table elements"); 272 uint32_t offset = seg.Offset.Value.Int32; 273 for (uint32_t index = 0; index < seg.Functions.size(); index++) { 274 275 uint32_t functionIndex = seg.Functions[index]; 276 tableEntries[functionIndex] = offset + index; 277 } 278 } 279 280 uint32_t sectionIndex = 0; 281 282 // Bool for each symbol, true if called directly. This allows us to implement 283 // a weaker form of signature checking where undefined functions that are not 284 // called directly (i.e. only address taken) don't have to match the defined 285 // function's signature. We cannot do this for directly called functions 286 // because those signatures are checked at validation times. 287 // See https://bugs.llvm.org/show_bug.cgi?id=40412 288 std::vector<bool> isCalledDirectly(wasmObj->getNumberOfSymbols(), false); 289 for (const SectionRef &sec : wasmObj->sections()) { 290 const WasmSection §ion = wasmObj->getWasmSection(sec); 291 // Wasm objects can have at most one code and one data section. 292 if (section.Type == WASM_SEC_CODE) { 293 assert(!codeSection); 294 codeSection = §ion; 295 } else if (section.Type == WASM_SEC_DATA) { 296 assert(!dataSection); 297 dataSection = §ion; 298 } else if (section.Type == WASM_SEC_CUSTOM) { 299 customSections.emplace_back(make<InputSection>(section, this)); 300 customSections.back()->setRelocations(section.Relocations); 301 customSectionsByIndex[sectionIndex] = customSections.back(); 302 } 303 sectionIndex++; 304 // Scans relocations to determine if a function symbol is called directly. 305 for (const WasmRelocation &reloc : section.Relocations) 306 if (reloc.Type == R_WASM_FUNCTION_INDEX_LEB) 307 isCalledDirectly[reloc.Index] = true; 308 } 309 310 typeMap.resize(getWasmObj()->types().size()); 311 typeIsUsed.resize(getWasmObj()->types().size(), false); 312 313 ArrayRef<StringRef> comdats = wasmObj->linkingData().Comdats; 314 for (StringRef comdat : comdats) { 315 bool isNew = ignoreComdats || symtab->addComdat(comdat); 316 keptComdats.push_back(isNew); 317 } 318 319 // Populate `Segments`. 320 for (const WasmSegment &s : wasmObj->dataSegments()) { 321 auto* seg = make<InputSegment>(s, this); 322 seg->discarded = isExcludedByComdat(seg); 323 segments.emplace_back(seg); 324 } 325 setRelocs(segments, dataSection); 326 327 // Populate `Functions`. 328 ArrayRef<WasmFunction> funcs = wasmObj->functions(); 329 ArrayRef<uint32_t> funcTypes = wasmObj->functionTypes(); 330 ArrayRef<WasmSignature> types = wasmObj->types(); 331 functions.reserve(funcs.size()); 332 333 for (size_t i = 0, e = funcs.size(); i != e; ++i) { 334 auto* func = make<InputFunction>(types[funcTypes[i]], &funcs[i], this); 335 func->discarded = isExcludedByComdat(func); 336 functions.emplace_back(func); 337 } 338 setRelocs(functions, codeSection); 339 340 // Populate `Globals`. 341 for (const WasmGlobal &g : wasmObj->globals()) 342 globals.emplace_back(make<InputGlobal>(g, this)); 343 344 // Populate `Events`. 345 for (const WasmEvent &e : wasmObj->events()) 346 events.emplace_back(make<InputEvent>(types[e.Type.SigIndex], e, this)); 347 348 // Populate `Symbols` based on the symbols in the object. 349 symbols.reserve(wasmObj->getNumberOfSymbols()); 350 for (const SymbolRef &sym : wasmObj->symbols()) { 351 const WasmSymbol &wasmSym = wasmObj->getWasmSymbol(sym.getRawDataRefImpl()); 352 if (wasmSym.isDefined()) { 353 // createDefined may fail if the symbol is comdat excluded in which case 354 // we fall back to creating an undefined symbol 355 if (Symbol *d = createDefined(wasmSym)) { 356 symbols.push_back(d); 357 continue; 358 } 359 } 360 size_t idx = symbols.size(); 361 symbols.push_back(createUndefined(wasmSym, isCalledDirectly[idx])); 362 } 363 } 364 365 bool ObjFile::isExcludedByComdat(InputChunk *chunk) const { 366 uint32_t c = chunk->getComdat(); 367 if (c == UINT32_MAX) 368 return false; 369 return !keptComdats[c]; 370 } 371 372 FunctionSymbol *ObjFile::getFunctionSymbol(uint32_t index) const { 373 return cast<FunctionSymbol>(symbols[index]); 374 } 375 376 GlobalSymbol *ObjFile::getGlobalSymbol(uint32_t index) const { 377 return cast<GlobalSymbol>(symbols[index]); 378 } 379 380 EventSymbol *ObjFile::getEventSymbol(uint32_t index) const { 381 return cast<EventSymbol>(symbols[index]); 382 } 383 384 SectionSymbol *ObjFile::getSectionSymbol(uint32_t index) const { 385 return cast<SectionSymbol>(symbols[index]); 386 } 387 388 DataSymbol *ObjFile::getDataSymbol(uint32_t index) const { 389 return cast<DataSymbol>(symbols[index]); 390 } 391 392 Symbol *ObjFile::createDefined(const WasmSymbol &sym) { 393 StringRef name = sym.Info.Name; 394 uint32_t flags = sym.Info.Flags; 395 396 switch (sym.Info.Kind) { 397 case WASM_SYMBOL_TYPE_FUNCTION: { 398 InputFunction *func = 399 functions[sym.Info.ElementIndex - wasmObj->getNumImportedFunctions()]; 400 if (sym.isBindingLocal()) 401 return make<DefinedFunction>(name, flags, this, func); 402 if (func->discarded) 403 return nullptr; 404 return symtab->addDefinedFunction(name, flags, this, func); 405 } 406 case WASM_SYMBOL_TYPE_DATA: { 407 InputSegment *seg = segments[sym.Info.DataRef.Segment]; 408 uint32_t offset = sym.Info.DataRef.Offset; 409 uint32_t size = sym.Info.DataRef.Size; 410 if (sym.isBindingLocal()) 411 return make<DefinedData>(name, flags, this, seg, offset, size); 412 if (seg->discarded) 413 return nullptr; 414 return symtab->addDefinedData(name, flags, this, seg, offset, size); 415 } 416 case WASM_SYMBOL_TYPE_GLOBAL: { 417 InputGlobal *global = 418 globals[sym.Info.ElementIndex - wasmObj->getNumImportedGlobals()]; 419 if (sym.isBindingLocal()) 420 return make<DefinedGlobal>(name, flags, this, global); 421 return symtab->addDefinedGlobal(name, flags, this, global); 422 } 423 case WASM_SYMBOL_TYPE_SECTION: { 424 InputSection *section = customSectionsByIndex[sym.Info.ElementIndex]; 425 assert(sym.isBindingLocal()); 426 return make<SectionSymbol>(flags, section, this); 427 } 428 case WASM_SYMBOL_TYPE_EVENT: { 429 InputEvent *event = 430 events[sym.Info.ElementIndex - wasmObj->getNumImportedEvents()]; 431 if (sym.isBindingLocal()) 432 return make<DefinedEvent>(name, flags, this, event); 433 return symtab->addDefinedEvent(name, flags, this, event); 434 } 435 } 436 llvm_unreachable("unknown symbol kind"); 437 } 438 439 Symbol *ObjFile::createUndefined(const WasmSymbol &sym, bool isCalledDirectly) { 440 StringRef name = sym.Info.Name; 441 uint32_t flags = sym.Info.Flags | WASM_SYMBOL_UNDEFINED; 442 443 switch (sym.Info.Kind) { 444 case WASM_SYMBOL_TYPE_FUNCTION: 445 if (sym.isBindingLocal()) 446 return make<UndefinedFunction>(name, sym.Info.ImportName, 447 sym.Info.ImportModule, flags, this, 448 sym.Signature, isCalledDirectly); 449 return symtab->addUndefinedFunction(name, sym.Info.ImportName, 450 sym.Info.ImportModule, flags, this, 451 sym.Signature, isCalledDirectly); 452 case WASM_SYMBOL_TYPE_DATA: 453 if (sym.isBindingLocal()) 454 return make<UndefinedData>(name, flags, this); 455 return symtab->addUndefinedData(name, flags, this); 456 case WASM_SYMBOL_TYPE_GLOBAL: 457 if (sym.isBindingLocal()) 458 return make<UndefinedGlobal>(name, sym.Info.ImportName, 459 sym.Info.ImportModule, flags, this, 460 sym.GlobalType); 461 return symtab->addUndefinedGlobal(name, sym.Info.ImportName, 462 sym.Info.ImportModule, flags, this, 463 sym.GlobalType); 464 case WASM_SYMBOL_TYPE_SECTION: 465 llvm_unreachable("section symbols cannot be undefined"); 466 } 467 llvm_unreachable("unknown symbol kind"); 468 } 469 470 void ArchiveFile::parse() { 471 // Parse a MemoryBufferRef as an archive file. 472 LLVM_DEBUG(dbgs() << "Parsing library: " << toString(this) << "\n"); 473 file = CHECK(Archive::create(mb), toString(this)); 474 475 // Read the symbol table to construct Lazy symbols. 476 int count = 0; 477 for (const Archive::Symbol &sym : file->symbols()) { 478 symtab->addLazy(this, &sym); 479 ++count; 480 } 481 LLVM_DEBUG(dbgs() << "Read " << count << " symbols\n"); 482 } 483 484 void ArchiveFile::addMember(const Archive::Symbol *sym) { 485 const Archive::Child &c = 486 CHECK(sym->getMember(), 487 "could not get the member for symbol " + sym->getName()); 488 489 // Don't try to load the same member twice (this can happen when members 490 // mutually reference each other). 491 if (!seen.insert(c.getChildOffset()).second) 492 return; 493 494 LLVM_DEBUG(dbgs() << "loading lazy: " << sym->getName() << "\n"); 495 LLVM_DEBUG(dbgs() << "from archive: " << toString(this) << "\n"); 496 497 MemoryBufferRef mb = 498 CHECK(c.getMemoryBufferRef(), 499 "could not get the buffer for the member defining symbol " + 500 sym->getName()); 501 502 InputFile *obj = createObjectFile(mb, getName()); 503 symtab->addFile(obj); 504 } 505 506 static uint8_t mapVisibility(GlobalValue::VisibilityTypes gvVisibility) { 507 switch (gvVisibility) { 508 case GlobalValue::DefaultVisibility: 509 return WASM_SYMBOL_VISIBILITY_DEFAULT; 510 case GlobalValue::HiddenVisibility: 511 case GlobalValue::ProtectedVisibility: 512 return WASM_SYMBOL_VISIBILITY_HIDDEN; 513 } 514 llvm_unreachable("unknown visibility"); 515 } 516 517 static Symbol *createBitcodeSymbol(const std::vector<bool> &keptComdats, 518 const lto::InputFile::Symbol &objSym, 519 BitcodeFile &f) { 520 StringRef name = saver.save(objSym.getName()); 521 522 uint32_t flags = objSym.isWeak() ? WASM_SYMBOL_BINDING_WEAK : 0; 523 flags |= mapVisibility(objSym.getVisibility()); 524 525 int c = objSym.getComdatIndex(); 526 bool excludedByComdat = c != -1 && !keptComdats[c]; 527 528 if (objSym.isUndefined() || excludedByComdat) { 529 flags |= WASM_SYMBOL_UNDEFINED; 530 if (objSym.isExecutable()) 531 return symtab->addUndefinedFunction(name, None, None, flags, &f, nullptr, 532 true); 533 return symtab->addUndefinedData(name, flags, &f); 534 } 535 536 if (objSym.isExecutable()) 537 return symtab->addDefinedFunction(name, flags, &f, nullptr); 538 return symtab->addDefinedData(name, flags, &f, nullptr, 0, 0); 539 } 540 541 bool BitcodeFile::doneLTO = false; 542 543 void BitcodeFile::parse() { 544 if (doneLTO) { 545 error(toString(mb.getBufferIdentifier()) + 546 ": attempt to add bitcode file after LTO."); 547 return; 548 } 549 550 obj = check(lto::InputFile::create(MemoryBufferRef( 551 mb.getBuffer(), saver.save(archiveName + mb.getBufferIdentifier())))); 552 Triple t(obj->getTargetTriple()); 553 if (t.getArch() != Triple::wasm32) { 554 error(toString(mb.getBufferIdentifier()) + ": machine type must be wasm32"); 555 return; 556 } 557 std::vector<bool> keptComdats; 558 for (StringRef s : obj->getComdatTable()) 559 keptComdats.push_back(symtab->addComdat(s)); 560 561 for (const lto::InputFile::Symbol &objSym : obj->symbols()) 562 symbols.push_back(createBitcodeSymbol(keptComdats, objSym, *this)); 563 } 564 565 } // namespace wasm 566 } // namespace lld 567