]> git.ipfire.org Git - thirdparty/elfutils.git/commit
libdwfl: elf_from_remote_memory should use pagesize, not p_align.
authorMark Wielaard <mjw@redhat.com>
Mon, 3 Mar 2014 10:43:43 +0000 (11:43 +0100)
committerMark Wielaard <mjw@redhat.com>
Mon, 10 Mar 2014 20:28:48 +0000 (21:28 +0100)
commitf15bcda4137446d4773bb54cb99cc18497e9822c
treeb530a36ff08e5d704d51c06d363e8a662b4f9a94
parentb92075265572739b04ed1027a6764ff65750b108
libdwfl: elf_from_remote_memory should use pagesize, not p_align.

elf_from_remote_memory would use the actual p_align of the PT_LOAD segments
to calculate the loadbase, end and start of a segment. But the dynamic
loader aligns the segments using the pagesize and only sanity checks the
p_align values. So we should do the same to get accurate segment addresses.
Also fixes a small memory leak in case the ELF image appears to be bad.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
libdwfl/ChangeLog
libdwfl/elf-from-memory.c
libdwfl/linux-proc-maps.c