[PATCH] D42105: [WebAssembly] Symbol changes #4: export relocatable, LLD only

Nicholas Wilson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 16 07:10:45 PST 2018


ncw created this revision.
ncw added reviewers: sbc100, sunfish.
Herald added subscribers: llvm-commits, aheejin, jgravelle-google, dschuff, jfb.

Fourth chunk split out of https://reviews.llvm.org/D41955.

There is no corresponding LLVM patch to go along with this.

Headline: Fix some bugs in the existing handling of exports when LLD generates "relocatable" output
---------------------------------------------------------------------------------------------------

  1. Changes:
- LLD's relocatable output was writing out an export for all globals (including file-local syms), but not for functions. Oops. To be consistent with non-relocatable output, all symbols (file-local and public) should be exported. Any symbol targetted by further relocations needs to be exported. The lack of local function exports was just an omission, I think.
- Second bug: Local symbol names can collide, causing an illegal Wasm file to be generated! Oops again. This only previously affected producing relocatable output from two files, where each had a global with the same name. We need to "budge" the symbol names for locals that are exported on relocatable output.
- Third bug: LLD's relocatable output wasn't writing out any symbol flags! Thus the local globals weren't being marked as local, and the hidden flag was also stripped...
- Added tests to exercise colliding local names with/without relocatable flag


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D42105

Files:
  test/wasm/Inputs/locals-duplicate1.ll
  test/wasm/Inputs/locals-duplicate2.ll
  test/wasm/call-indirect.ll
  test/wasm/init-fini.ll
  test/wasm/locals-duplicate.test
  test/wasm/relocatable.ll
  test/wasm/visibility-hidden.ll
  wasm/Writer.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42105.129952.patch
Type: text/x-patch
Size: 39477 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180116/f48637dc/attachment.bin>


More information about the llvm-commits mailing list