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:29:36 +0000 (22:29 -0400)
commite1f0c5692aa0f75c547e28efd734cc911503c4f3
treec1d0ba006ccfec30c079582d4c3d677b6d272731
parent2b4444ce6a9fa02ae46a67085c17aef55dc85941
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.024784 seconds and 4 git commands to generate.