summaryrefslogtreecommitdiff
path: root/tests/emptyfile.c
Commit message (Collapse)AuthorAgeFilesLines
* Switch from numerical to defined constants for permissions.Érico Rolim2020-11-031-3/+4
| | | | | | | | | | | Use defined constants for permission values. Also add fallback definitions for them in system.h, to allow for compatibility with systems that don't provide these macros. Include system.h in all tests/ files that required it. Signed-off-by: Érico Rolim <erico.erc@gmail.com> Signed-off-by: Mark Wielaard <mark@klomp.org>
* 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 <john.ogness@linutronix.de> Signed-off-by: Mark Wielaard <mjw@redhat.com>