libelf: Correctly setup alignment of SHF_COMPRESSED section data.
authorMark Wielaard <mark@klomp.org>
Tue, 13 Nov 2018 20:18:09 +0000 (21:18 +0100)
committerMark Wielaard <mark@klomp.org>
Tue, 13 Nov 2018 20:30:17 +0000 (21:30 +0100)
commitcf10453f8252df81225796d98548ba6eac113df3
tree13cea388f62135b702fe1db133dd842e1bf2873a
parentd3e6266754b95244063aa1e40c531fdd57259332
libelf: Correctly setup alignment of SHF_COMPRESSED section data.

We didn't set the alignment of SHF_COMPRESSED sections correctly.
Those sections start with an Elf(32|64)_Chdr. Make sure sh_addralign
is setup to be able to read such a struct directly. Likewise don't
trust the alignment set on any SHF_COMPRESSED section, but always
make the (raw) compressed data aligned correctly for the reading the
Elf(32|64)_Chdr directly.

Signed-off-by: Mark Wielaard <mark@klomp.org>
libelf/ChangeLog
libelf/elf_compress.c
libelf/elf_getdata.c