[PATCH] D25627: [ELF] Convert linker generated sections to input sections
Eugene Leviant via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 31 07:04:11 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);
+}
----------------
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 ?
https://reviews.llvm.org/D25627
More information about the llvm-commits
mailing list