Re: [PATCH] libelf: Fix some issues with ELF_C_RDWR_MMAP.

2018-09-13 Thread Mark Wielaard
On Wed, 2018-09-12 at 15:02 +0200, Mark Wielaard wrote: > When ELF_C_RDWR_MMAP is used libelf might have to write overlapping memory > when moving the section data or headers. Make sure to use memmove, not > memcpy. Also the size of the underlying file might have to change. That > means we will hav

[PATCH] libelf: Fix some issues with ELF_C_RDWR_MMAP.

2018-09-12 Thread Mark Wielaard
When ELF_C_RDWR_MMAP is used libelf might have to write overlapping memory when moving the section data or headers. Make sure to use memmove, not memcpy. Also the size of the underlying file might have to change. That means we will have to also extend the mmap region with mremap. Since we are using