[PATCH] D34657: [WebAssembly] Add data size and alignment to linking section

Derek Schuff via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 27 10:19:48 PDT 2017


dschuff added inline comments.


================
Comment at: lib/MC/WasmObjectWriter.cpp:887
 
+  startSection(SubSection, wasm::WASM_DATA_SIZE);
+  encodeULEB128(DataSize, getStream());
----------------
It looks like these sections will come out of order wrt their enum values above. Should we just make data size and alignment be numbers 0 and 1?


================
Comment at: lib/MC/WasmObjectWriter.cpp:932
   SmallVector<char, 0> DataBytes;
+  uint32_t DataAlignment = 0;
   uint32_t StackPointerGlobal = 0;
----------------
Maybe we should make the min data alignment be 1? Should we have 0 or missing alignment be some default? Maybe the default should just be the min too. Or we could have the min be 4; in general I guess we'd probably want numbers to have min alignment of 4 (which we can also set in the compiler), but for strings maybe we don't care and can let it be less?


https://reviews.llvm.org/D34657





More information about the llvm-commits mailing list