]> git.ipfire.org Git - thirdparty/elfutils.git/commit
libelf: If xlate can only convert the ELF note header, just do that.
authorMark Wielaard <mark@klomp.org>
Tue, 30 Apr 2019 11:00:17 +0000 (13:00 +0200)
committerMark Wielaard <mark@klomp.org>
Sat, 4 May 2019 19:31:08 +0000 (21:31 +0200)
commit1d8f5d30a92285fd4e7895a1d00587ac487412e3
tree4daa1df6e8f87cf7286e3c276e7729fda2fee9a0
parent62bed2018232379ac91020137df37afe5e6a5579
libelf: If xlate can only convert the ELF note header, just do that.

When we started parsing new style ELF_T_NHDR8 notes we added extra
checks on alignment and padding. When those failed we would stop
converting and just return the rest of the ELF Note unconverted.
In the case were we just had enough data for just the ELF Note header
and the destionation and source weren't the same we would then
accidentially throw away the Note header conversion we just did.

Fix that by indicating we did correctly convert just the header.

Adds testcase that compares parsing ELF notes with gelf_getnote
and parsing the raw data by hand using elf32_xlatetom using just
the Note header and ignoring the (raw) note data.

Signed-off-by: Mark Wielaard <mark@klomp.org>
libelf/ChangeLog
libelf/note_xlate.h
tests/ChangeLog
tests/Makefile.am
tests/run-xlate-note.sh [new file with mode: 0755]
tests/xlate_notes.c [new file with mode: 0644]