[PATCH] D25627: [ELF] Convert linker generated sections to input sections
Eugene Leviant via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 31 10:38:29 PDT 2016
evgeny777 added inline comments.
================
Comment at: ELF/InputSection.cpp:863
+ memcpy(Buf.data() + 12, "GNU", 4); // Name string
+ this->Data = ArrayRef<uint8_t>(Buf);
+}
----------------
ruiu wrote:
> 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.
Ok. Does it make sense to convert other sections (like .got and .got.plt) now ?
https://reviews.llvm.org/D25627
More information about the llvm-commits
mailing list