[PATCH] D44184: Write DWARF data into WASM object file

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 15 10:29:22 PDT 2018


sbc100 added inline comments.


================
Comment at: include/llvm/BinaryFormat/Wasm.h:155
     // space.
     uint32_t ElementIndex;
     // For a data symbols, the address of the data relative to segment.
----------------
Could we just use the the section index here and reuse the existing ElementIndex?   (Or at last move the Section inside the union?)


================
Comment at: lib/MC/WasmObjectWriter.cpp:927
 
+void WasmObjectWriter::writeDebugRelocSections() {
+  for (const auto& P: CustomSectionsRelocations) {
----------------
Is there anything debug specific here?  How about `writeCustomRelocSections()`?

Or better still factor out the duplicate code in writeCodeRelocSection and writeDataRelocSection in single `writeRelocSection(Name, Relocations);`, then call that in a loop?


================
Comment at: lib/Object/WasmObjectFile.cpp:1074
   case wasm::WASM_SYMBOL_TYPE_GLOBAL:
+  case wasm::WASM_SYMBOL_TYPE_SECTION:
     return SymbolRef::ST_Other;
----------------
ELF uses ST_Debug for STT_SECTION symbols.  (see include/llvm/Object/ELFObjectFile.h)


Repository:
  rL LLVM

https://reviews.llvm.org/D44184





More information about the llvm-commits mailing list