]> git.ipfire.org Git - thirdparty/elfutils.git/commit
libelf: Always update e_version and e_shentsize in elf_update.
authorMark Wielaard <mjw@redhat.com>
Tue, 29 Sep 2015 15:04:11 +0000 (17:04 +0200)
committerMark Wielaard <mjw@redhat.com>
Mon, 5 Oct 2015 19:50:51 +0000 (21:50 +0200)
commit3adda3ce2a83e2733aa0c84da9bb7949413d02fd
tree058bc279d05d01de93eac34fdc7705d720f865e2
parenta3a76e361527b057fc4cf8a8a8ce97a33dd59198
libelf: Always update e_version and e_shentsize in elf_update.

When e_version is EV_NONE we should set it to EV_CURRENT like we do for
the EI_VERSION and like we set EI_DATA to the correct byte order when set
to ELFDATANONE.  Likewise we should always set e_shentsize like we do for
e_phentsize, not just when ELF_F_LAYOUT isn't set.

Add a new elfshphehdr testcase to check the above.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
libelf/ChangeLog
libelf/elf32_updatenull.c
tests/ChangeLog
tests/Makefile.am
tests/elfshphehdr.c [new file with mode: 0644]