[PATCH] D39107: [WebAssembly] MC: Don't allow zero sized data segments

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 23 15:44:10 PDT 2017


sbc100 added inline comments.


================
Comment at: lib/MC/WasmObjectWriter.cpp:526
     } else if (auto *Fill = dyn_cast<MCFillFragment>(&Frag)) {
       DataBytes.insert(DataBytes.end(), Fill->getSize(), Fill->getValue());
     } else {
----------------
dschuff wrote:
> should we set LastFragmentSize to the fill size here and/or for align frags above? I guess if the answer is "no" it's because they do not represent symbols?
Basically yes.  Zero sized fill fragments do seem to exist but don't represent symbols.  They seems to be generated to inject padded between elements of global arrays.  So I don't think its possible to have a symbol point to them. 

I do think we might need a better solution to this issue in the long run though.  Perhaps adding specifying explicitly which segment a symbol belongs too?


https://reviews.llvm.org/D39107





More information about the llvm-commits mailing list