summaryrefslogtreecommitdiffstats
path: root/tests/emptyfile.c
Commit message (Collapse)AuthorAgeFilesLines
* Open files in O_BINARYUlf Hermann2017-05-081-3/+3
| | | | | | | | | If O_BINARY is not defined, define it to 0, so that the change has no effect then. Some systems have separate binary and text modes for files, and we don't want the text mode to be used. Change-Id: If7efb5bd448c2a1c7d1eb5dab276849b1b15a3ce Reviewed-by: Christian Kandeler <[email protected]>
* libelf: find 1st section instead of assumingJohn Ogness2016-06-281-0/+277
When getting section headers it is assumed that the first section is on the first section list. However, it is possible that the first section list only contains the zeroth section, in which case either illegal memory access occurs or elf_nextscn() erroneously returns NULL. With this patch, checks are added to avoid the illegal memory access and (if available) the second section list is looked at to find the first section. A new test emptyfile is added that tests adding a section to and "empty" ELF file 32/64 class with ELF_C_RDWR[_MMAP]. Signed-off-by: John Ogness <[email protected]> Signed-off-by: Mark Wielaard <[email protected]>