[PATCH] D42282: [WebAssembly] Update to match llvm change to SYM_INFO section

Nicholas Wilson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 19 01:45:58 PST 2018


ncw added inline comments.


================
Comment at: wasm/Writer.cpp:397
+                                             : WASM_EXTERNAL_GLOBAL;
+      SymbolInfo.emplace_back(Kind, E.Sym->getOutputIndex(), Flags);
+    }
----------------
Does this really work? I had to introduce the concept of "output symbol index" (`getOutputSymbolIndex`) for writing out the relocations and syminfo in LLD.

That's because LLD doesn't have (and never has had) the duplicate-import fiddle that WasmObjectWriter has (LLD uses the "alt indexes" when it reads in the files, but it can't write them out).

So how can the function's output index work here - when it's not the same concept as the symbol output index? The function and symbol indexes can diverge.

It's very very close to being correct, but I don't think it is fully correct.

The #5 changes do need to come first for this to be "right".

Once it's fixed, `relocatable.ll` should gain some tests for aliases, since it looks like it doesn't have any, oops.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D42282





More information about the llvm-commits mailing list