summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/kernel/initcall.c1
-rw-r--r--ldelf/ta_elf.c11
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);
}