summaryrefslogtreecommitdiffstats
path: root/tests/addsections.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'elfutils-0.174'Ulf Hermann2018-10-111-1/+1
| | | | | | elfutils 0.174 release Change-Id: Ibcbdfca61cf0b65391ab6d0ad00f18ba61027e07
* libelf: Fix some issues with ELF_C_RDWR_MMAP.Mark Wielaard2018-09-131-0/+286
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 direct pointers into the mmapped area we cannot move the mmap, only extend it. This might still fail if there is not enough free memory available to extend the mmap region. Two new test programs have been added. elfcopy which copies a whole elf file (using either ELF_C_WRITE or ELF_C_WRITE_MMAP). And addsections which adds new sections to an existing ELF file (using either ELF_C_RDWR or ELF_C_RDWR_MMAP). The newly added test will fail under valgrind without the fixes. Signed-off-by: Mark Wielaard <[email protected]>