[PATCH] D56947: [WebAssembly] Fix crash with LTO + relocatable + undefined symbols

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 22 14:51:01 PST 2019


pcc added inline comments.


================
Comment at: wasm/Writer.cpp:906
 
   unsigned SymbolIndex = SymtabEntries.size();
   for (ObjFile *File : Symtab->ObjectFiles) {
----------------
Maybe this would be better as

```
for (Symbol *Sym : Symtab->getSymbols()) {
  // handle global symbols
}

for (ObjFile *File : Symtab->ObjectFiles) {
  for (Symbol *Sym : File->getSymbols()) {
    if (!Sym->isLocal())
      continue;
    // handle local/section symbols
  }
}
```
? I believe that's how we handle `.symtab` in ELF for example.


Repository:
  rLLD LLVM Linker

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56947/new/

https://reviews.llvm.org/D56947





More information about the llvm-commits mailing list