libelf: Take map offset into account for Shdr alignment check in elf_begin
authorMark Wielaard <mark@klomp.org>
Thu, 17 Mar 2022 12:58:56 +0000 (13:58 +0100)
committerMark Wielaard <mark@klomp.org>
Thu, 17 Mar 2022 23:54:51 +0000 (00:54 +0100)
commit1b09e67353f46f2ff9039da78a37d7717155df08
tree96a93a626311940ca3496289db2da8f2729075ac
parent9a36370010df049b1d301a5531246ec7a693b95b
libelf: Take map offset into account for Shdr alignment check in elf_begin

The sh_num function tries to get at the zero section Shdr directly.
When the file is mmapped it has to make sure the offset into the file
to the start of the Elf structure is taken into account when trying to
cast the address to make sure the alignment is correct.

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