[PATCH] D41510: [WebAssembly] MC: Fix for address taken aliases

Nicholas Wilson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 17 06:34:13 PST 2018


ncw added inline comments.
Herald added a subscriber: llvm-commits.


================
Comment at: llvm/trunk/lib/MC/WasmObjectWriter.cpp:1285
+        case wasm::R_WEBASSEMBLY_MEMORY_ADDR_I32:
+        case wasm::R_WEBASSEMBLY_MEMORY_ADDR_SLEB: {
+          uint32_t Index = SymbolIndices.find(&WS)->second;
----------------
sbc100 wrote:
> ncw wrote:
> > Having just approved this, I'm wondering why we have to handle the MEMORY_ADDR relocations? OK, so I can see that IsAddressTaken used to handle them - but was for address-taken globals? Since we're now inside as `isFunction()` block, I'd have thought that only TABLE_INDEX relocations can target the symbol.
> I think are you right.  IsAddressTaken was built to include globals and functions but only ever used for functions, so these cases can be removed I think.
For the record: the unused switch cases were (will be) removed in D42095


Repository:
  rL LLVM

https://reviews.llvm.org/D41510





More information about the llvm-commits mailing list