On Fri, 2013-11-08 at 19:28 +0100, Mark Wielaard wrote:
When the elf file is mmapped ehdr can still point to ehdr_mem if the
address is unaligned. In such cases we do need to memcpy the ehdr back
to the file. We shouldn't when ehdr already comes directly from the mmapped
file, because that would cause an memcpy call with overlapping addresses
(ehdr being copied directly over itself).
+2013-11-08 Mark Wielaard <mjw(a)redhat.com>
+
+ * elf32_updatefile.c (elfXX_updatemmap): Only memcpy ehdr when not
+ already directly mmapped.
I pushed this to master.