Searched hist:c0c57c8fa58346f3b0837a02c313e447c91b74c9 (Results 1 – 1 of 1) sorted by relevance
| /optee_os/scripts/ |
| H A D | symbolize.py | c0c57c8fa58346f3b0837a02c313e447c91b74c9 Wed Jan 08 13:57:32 UTC 2020 Jerome Forissier <jerome@forissier.org> symbolize.py: fix stack dump of TEE core with pager
Commit 105e09c24479 ("symbolize.py: add support for TEE core ASLR") has introduced support for ASLR by using addresses relative to the .text section. To this end, the '-j.text' option is passed to addr2line. Unfortunately, it happens that addr2line does not like to be given addresses that are outside the specified section. This can happen when CFG_WITH_PAGER=y as shown in the following example:
D/TC:4 0 TEE load address @ 0x3f000000 D/TC:4 0 Call stack: D/TC:4 0 0x000000003f0080ac read_pc at optee_os/core/arch/arm/include/arm64.h:237 D/TC:4 0 0x000000003f062984 ?? ??:0 D/TC:4 0 0x000000003f007be4 wq_wait_final at optee_os/core/arch/arm/kernel/wait_queue.c:88 D/TC:4 0 0x000000003f007698 __mutex_lock at optee_os/core/arch/arm/kernel/mutex.c:57 D/TC:4 0 0x000000003f06c204 ?? ??:0 D/TC:4 0 0x000000003f067160 ?? ??:0 D/TC:4 0 0x000000003f06221c ?? ??:0 D/TC:4 0 0x000000003f006298 thread_std_smc_entry at optee_os/core/arch/arm/kernel/thread_optee_smc_a64.S:162
The addresses that cannot be resolved happen to be inside section .text_pageable, not .text (excerpt from readelf -e tee.elf):
[Nr] Name Type Address Offset [ 1] .text PROGBITS 000000003f000000 00010000 [11] .text_pageable PROGBITS 000000003f05f388 0006f388
This commit choses a different approch. Instead of using relative addresses, we keep absolute ones but correct them with the load address in the ELF file:
corrected address = supplied address - runtime start address + link time load address
Fixes: 105e09c24479 ("symbolize.py: add support for TEE core ASLR") Signed-off-by: Jerome Forissier <jerome@forissier.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
|