]> git.ipfire.org Git - thirdparty/elfutils.git/commit
libelf: Explicitly update section data after (de)compression.
authorMark Wielaard <mark@klomp.org>
Fri, 9 Nov 2018 08:18:22 +0000 (08:18 +0000)
committerMark Wielaard <mark@klomp.org>
Fri, 9 Nov 2018 16:34:30 +0000 (17:34 +0100)
commit4789e0fb92b03c3d8de548489c871d17f8f35cd0
tree12f4335f80e2a870c52b2819f26eb0025b70d05c
parent1628254ba2157ac2b78fc9e103fe0b16fa288a26
libelf: Explicitly update section data after (de)compression.

We need to explictly trigger a section data reload after updating the
ELF section rawdata to make sure it gets written out to disk on an
elf_update. Doing this showed one bug/inefficiently when the underlying
file has a different endianness. In that case for debug sections we
would convert by allocating a new buffer and just copying over the
raw data into a new buffer. This is not really necessary and would
hide any relocations done on the rawdata by libdwfl.

Added a couple of new ppc64 big endian testfiles that show the issue.

Signed-off-by: Mark Wielaard <mark@klomp.org>
libelf/ChangeLog
libelf/elf_compress.c
libelf/elf_getdata.c
tests/ChangeLog
tests/Makefile.am
tests/run-readelf-zdebug-rel.sh
tests/run-strip-reloc.sh
tests/testfile-debug-rel-ppc64-g.o.bz2 [new file with mode: 0644]
tests/testfile-debug-rel-ppc64-z.o.bz2 [new file with mode: 0644]
tests/testfile-debug-rel-ppc64.o.bz2 [new file with mode: 0644]