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)
commit68d4b11c7235d97e14a4e1d20004a7a839d5f880
treeca9032c86d0c0d4b97d35193760e0057272b9c7c
parent468589da1a60b5288b5ffa75b0f21a91dcb5bc8b
Fix: erroneous computation of ELF in-memory size

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>
include/lttng/ust-elf.h
liblttng-ust/lttng-ust-elf.c
This page took 0.024853 seconds and 4 git commands to generate.