Fix: erroneous computation of ELF in-memory size
authorAntoine Busque <abusque@efficios.com>
Mon, 9 May 2016 21:54:44 +0000 (17:54 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 10 May 2016 02:36:50 +0000 (22:36 -0400)
The current algorithm for computation of ELF in-memory size computed
values using the `p_align` field from program headers to align loaded
segments, when in fact `p_align` is only used to describe the
relationship between a segment's offset in the ELF file and its
virtual address once loaded in memory (`p_vaddr`), not the alignment
between segments. (Refer to the ELF specification version 1.1 at pages
2-2 and 2-8 for more details.)

This implementation instead uses the `p_memsz` and `p_vaddr` fields to
compute the highest virtual address of the executable, and uses the
difference from its base address as the in-memory size.

Signed-off-by: Antoine Busque <abusque@efficios.com>

No differences found
This page took 0.026018 seconds and 4 git commands to generate.