[PATCH] D25627: [ELF] Convert linker generated sections to input sections

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 31 10:36:38 PDT 2016


ruiu accepted this revision.
ruiu added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: ELF/InputSection.cpp:863
+  memcpy(Buf.data() + 12, "GNU", 4);           // Name string
+  this->Data = ArrayRef<uint8_t>(Buf);
+}
----------------
evgeny777 wrote:
> evgeny777 wrote:
> > ruiu wrote:
> > > Here, you fill the internal buffer with data, which to be memcpy'ed to the final output buffer. I think we don't want to do that. Instead, we want to virtualize InputFile's `writeTo` so that each input section will directly write to the output buffer.
> > Besides writeTo one will also have to virtualize getSize(), in order for assignOffsets to work properly
> Also if you virtualize getSize() then you'll get different values from Data.size() and getSize(). The getDataAs<T> won't work either. Does extra copying really provide that much overhead ?
I don't know about that. We might want to create a large virtual section, but I don't have a concrete example now. Because this patch is pretty straightforward and simple, let's land this. We can revisit later.


https://reviews.llvm.org/D25627





More information about the llvm-commits mailing list