[Lldb-commits] [PATCH] D40079: Make sure DataBufferLLVM contents are writable

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Nov 15 10:16:57 PST 2017


labath added a comment.

In https://reviews.llvm.org/D40079#926328, @clayborg wrote:

> I had suggested in https://reviews.llvm.org/D38142 that we have ObjectFileELF check the file type of the file and only map with write abilities if the ELF file is an object file since that is the only time we need relocations. If we can pass a flag through to indicate how to map, would that provide any additional performance improvements?


Sorry, I hadn't seen that comment.

But to answer to question, it would not provide *additional* performance improvements -- the memory will still be shared until you actually try to write to it (with the read-only shared mapping you'll get a SEGV, with a private read-write mapping, the page will be COWed).

However, I suppose something like that could be done *instead* of this patch. That way we would be using mmap for most object files, and only resorting to malloc+read for those that need relocating. It's not an ideal solution, but then again, neither is this.


https://reviews.llvm.org/D40079





More information about the lldb-commits mailing list