[PATCH] D62744: [WebAssembly] Don't export __data_end and __heap_start by default.

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 3 14:21:02 PDT 2019


sbc100 marked 2 inline comments as done.
sbc100 added inline comments.


================
Comment at: lld/trunk/wasm/Config.h:62
   llvm::StringSet<> AllowUndefinedSymbols;
+  llvm::StringSet<> ExportedSymbols;
   std::vector<llvm::StringRef> SearchPaths;
----------------
ruiu wrote:
> IIRC, the iteration order of StringSet is different between 32-bit and 64-bit hosts. That's bad for build reproducibility because even if all input files, command line options, and the linker versions are the same, two lld executables create different binaries if one is a 32-bit executable and the other is 64-bit one.
> 
> I'd use llvm/ADT/SetVector, which guarantees the iteration order.
We don't actually iterate over this set, we only test for presence symbol names.


================
Comment at: lld/trunk/wasm/SymbolTable.cpp:202
 
 DefinedData *SymbolTable::addOptionalDataSymbol(StringRef Name, uint32_t Value,
                                                 uint32_t Flags) {
----------------
ruiu wrote:
> This function seems a little tricky. Can you expand the comment? I believe the intended behavior is this:
> 
>   Add a symbol with a given name if there's an undefined symbol with the same name. If we are exporting all symbols, a symbol is added unconditionally.
Yes, you are correct.  I will add a comment.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D62744





More information about the llvm-commits mailing list