malloc: Remove LD_TRACE_PRELINKING usage from mtrace
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Fri, 21 Jan 2022 13:20:50 +0000 (10:20 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 10 Feb 2022 12:16:13 +0000 (09:16 -0300)
commitd7703d3176d225d5743b21811d888619eba39e82
tree5a4586f8fe3459d45319cac801366dd92510d5b2
parent6628c742b2c16e785d3c884d9deeda5adb30ca12
malloc: Remove LD_TRACE_PRELINKING usage from mtrace

The fix for BZ#22716 replacde LD_TRACE_LOADED_OBJECTS with
LD_TRACE_PRELINKING so mtrace could record executable address
position.

To provide the same information, LD_TRACE_LOADED_OBJECTS is
extended where a value or '2' also prints the executable address
as well.  It avoid adding another loader environment variable
to be used solely for mtrace.  The vDSO will be printed as
a default library (with '=>' pointing the same name), which is
ok since both mtrace and ldd already handles it.

The mtrace script is changed to also parse the new format.  To
correctly support PIE and non-PIE executables, both the default
mtrace address and the one calculated as used (it fixes mtrace
for non-PIE exectuable as for BZ#22716 for PIE).

Checked on x86_64-linux-gnu.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
NEWS
elf/dl-main.h
elf/rtld.c
malloc/mtrace.pl