3 Commits

Author SHA1 Message Date
Érico Rolim ced66615bd Switch from numerical to defined constants for permissions.
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>
2020-11-03 15:54:14 +01:00
Mark Wielaard 2e09635f3e tests: Use PRId64 for printing loff_t.
loff_t is always 64bits.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
2015-02-19 00:44:04 +01:00
Mark Wielaard b543cdd95a libelf: Fix elf_newdata when raw ELF file/image data is available.
When ELF data for a section has been read by elf_rawdata, data_read
and rawdata_base are set, but data_list_rear will not be set until the
data will be converted (by elf_getdata). elf_newdata would overwrite
the existing data in that case. Both elf_getdata and elf_update rely
on the fact that when data_list_rear is set they don't have to look
at the raw data anymore. So make sure we update the data list properly
before adding any new data and raw data is available in elf_newdata.

Add newdata test that calls elf_newdata before and after elf_rawdata
and elf_getdata and checks the new size and contents of the section.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
2015-02-06 22:24:08 +01:00