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

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 2 21:17:14 PDT 2019


ruiu added inline comments.


================
Comment at: lld/trunk/wasm/Config.h:62
   llvm::StringSet<> AllowUndefinedSymbols;
+  llvm::StringSet<> ExportedSymbols;
   std::vector<llvm::StringRef> SearchPaths;
----------------
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.


================
Comment at: lld/trunk/wasm/SymbolTable.cpp:202
 
 DefinedData *SymbolTable::addOptionalDataSymbol(StringRef Name, uint32_t Value,
                                                 uint32_t Flags) {
----------------
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.


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