<div dir="ltr"><div class="gmail_extra"><div><div class="gmail_signature">On Thu, Jun 15, 2017 at 12:31 PM, Jake Ehrlich via Phabricator <span dir="ltr"><<a href="mailto:reviews@reviews.llvm.org" target="_blank">reviews@reviews.llvm.org</a>></span> wrote:<br></div></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">jakehehrlich marked 14 inline comments as done.<br>
jakehehrlich added a comment.<br>
<span class="gmail-"><br>
In <a href="https://reviews.llvm.org/D33964#781402" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D33964#781402</a>, @meadori wrote:<br>
<br>
> I having looked through the fine details yet, but one higher level question: I saw the discussions on the mailing list concerning being careful not to go overboard making everything work with multiple object file formats and to start with ELF.  That being said, why can't just the ELF functionality of libObject be extended to write?  Seems like going that way would make it easier for others to reuse in other tools.<br>
<br>
<br>
</span>As I understand it libObject reads in the file to memory and then simply reinterpret_casts the different chunks of the file into the corresponding parts. So when you get an Elf64_Shdr* from the libObject interface you actually are getting a pointer into the file data. It's sort of like "in-place" file parsing. It might even be memory mapping the file, I'm not sure. My point is that It does not have it's own internal modifiable representation of the file. It just has the raw data from the file. Changing the interface to include section/symbol removal (which involves changing file layout and modifying sections like .shstrtab and .shtab) would cause the internal workings of libObject to change a lot I think. Perhaps someone can confirm my understanding?<br></blockquote><div><br></div><div>Correct. libObject directly references memory mapped files. Extending libObject to write files is a huge effort that hasn't proven to be worth the effort over the current approach.</div><div><br></div><div>- Michael Spencer<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div class="gmail-HOEnZb"><div class="gmail-h5"><br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
<a href="https://reviews.llvm.org/D33964" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D33964</a><br>
<br>
<br>
<br>
</div></div></blockquote></div><br></div></div>