diff options
author | Jun Nie <jun.nie@linaro.org> | 2021-04-26 16:34:56 +0800 |
---|---|---|
committer | Jun Nie <jun.nie@linaro.org> | 2021-04-26 16:34:56 +0800 |
commit | efcf5ee5544287ed6132d1227f0af3ec2b7d69cc (patch) | |
tree | bf751a4c69d188ce6e36d6a006fa64a7bdb4ec3f | |
parent | 3f73eeecde874e6efb90ecb1076b9b96232fc3e4 (diff) |
debug: add print for ldelfimx_5.4.70_2.3.0+fio+spm-debug-ldelf
to debug:
D/TC:0 ffa_secondary_cpu_boot_req:70 SET_ENTRY_POINT op mpidr 0x80000003 done
D/TC:0 0 sp_init_user_session:462 Loading SP dc1eef48-b17a-4ccf-ac8b-dfcff7711b14
D/TC:0 0 load_ldelf:704 ldelf load address 0x80006000
D/LD: ldelf:134 Loading TA dc1eef48-b17a-4ccf-ac8b-dfcff7711b14
D/TC:0 0 tee_ta_init_pseudo_ta_session:283 Lookup pseudo TA 3a2f8978-5dc0-11e8-9c2d-fa7ae01bbebc
D/TC:0 0 tee_ta_init_pseudo_ta_session:296 Open system.pta
D/TC:0 0 tee_ta_init_pseudo_ta_session:310 system.pta : 3a2f8978-5dc0-11e8-9c2d-fa7ae01bbebc
D/TC:0 0 system_open_ta_binary:257 Lookup user TA ELF dc1eef48-b17a-4ccf-ac8b-dfcff7711b14 (early TA)
D/TC:0 0 system_open_ta_binary:261 res=0x0
E/LD: check_range:235 DT_HASH 0x0 out of range 0x80033000
E/TC:0 0 init_with_ldelf:232 ldelf failed with res: 0xffff0005
D/TC:0 0 tee_ta_close_session:507 csess 0x560cfb50 id 32770
D/TC:0 0 tee_ta_close_session:527 Destroy session
E/TC:0 0 sp_enter_close_session:735 Closing sessions is not support for SP's
Signed-off-by: Jun Nie <jun.nie@linaro.org>
-rw-r--r-- | core/kernel/initcall.c | 1 | ||||
-rw-r--r-- | ldelf/ta_elf.c | 11 |
2 files changed, 11 insertions, 1 deletions
diff --git a/core/kernel/initcall.c b/core/kernel/initcall.c index 34a4edc7c..d2c52eea3 100644 --- a/core/kernel/initcall.c +++ b/core/kernel/initcall.c @@ -24,6 +24,7 @@ void __weak call_initcalls(void) EMSG("Initcall __text_start + 0x%08" PRIxVA " failed", (vaddr_t)call - VCORE_START_VA); } + DMSG("%s() initcall done", call->func_name); } } diff --git a/ldelf/ta_elf.c b/ldelf/ta_elf.c index 66801a613..3c280b5ce 100644 --- a/ldelf/ta_elf.c +++ b/ldelf/ta_elf.c @@ -212,9 +212,13 @@ static void save_hashtab_from_segment(struct ta_elf *elf, unsigned int type, assert(!(memsz % dyn_entsize)); num_dyns = memsz / dyn_entsize; +trace_printf_helper(TRACE_ERROR, true, "elf->load_addr 0x%lx, num_dyns 0x%lx = memsz 0x%lx / dyn_entsize 0x%lx)\n", elf->load_addr, num_dyns, memsz, dyn_entsize); for (n = 0; n < num_dyns; n++) { read_dyn(elf, addr, n, &tag, &val); +trace_printf_helper(TRACE_ERROR, true, "addr 0x%lx tag: 0x%x val 0x%lx)\n", addr, tag, val); + // why this never true? if (tag == DT_HASH) { +trace_printf_helper(TRACE_ERROR, true, "elf->hashtab = (void *)(val 0x%lx + elf->load_addr 0x%lx)\n", val, elf->load_addr); elf->hashtab = (void *)(val + elf->load_addr); break; } @@ -227,7 +231,9 @@ static void check_range(struct ta_elf *elf, const char *name, const void *ptr, size_t max_addr = 0; if ((vaddr_t)ptr < elf->load_addr) - err(TEE_ERROR_BAD_FORMAT, "%s %p out of range", name, ptr); + { + err(TEE_ERROR_BAD_FORMAT, "%s %p out of range 0x%lx", name, ptr, elf->load_addr); + } if (ADD_OVERFLOW((vaddr_t)ptr, sz, &max_addr)) err(TEE_ERROR_BAD_FORMAT, "%s range overflow", name); @@ -283,6 +289,7 @@ static void save_hashtab(struct ta_elf *elf) } check_hashtab(elf, elf->hashtab, 0, 0); +trace_printf_helper(TRACE_ERROR, true, "========== hashtab ptr = 0x%p\n", elf->hashtab); hashtab = elf->hashtab; check_hashtab(elf, elf->hashtab, hashtab[0], hashtab[1]); } @@ -401,6 +408,7 @@ static void save_symtab(struct ta_elf *elf) { size_t n = 0; +trace_printf_helper(TRACE_ERROR, true, "func %s called\n", __func__); if (elf->is_32bit) { Elf32_Shdr *shdr = elf->shdr; @@ -714,6 +722,7 @@ static size_t get_pad_begin(void) if (res) { DMSG("Random read failed: %#"PRIx32, res); return min * SMALL_PAGE_SIZE; + //rnd32 = 33203; } rnd = rnd32 % (max - min); } |