summaryrefslogtreecommitdiff
path: root/lib/initcall.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2024-06-23 14:30:22 -0600
committerTom Rini <trini@konsulko.com>2024-07-04 09:25:20 -0600
commit57c4cd17e6988d9ba4b9184f7b4e66ff0c22108f (patch)
tree68058a756132fb0b50e45fe8700971118cc89739 /lib/initcall.c
parentcb44201c7182f9367e7e0dd1b009a85e26fc1a83 (diff)
initcall: Correct use of relocation offset
The relocation offset can change in some initcall sequences. Handle this and make sure it is used for all debugging statements in init_run_list() Update the trace test to match. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
Diffstat (limited to 'lib/initcall.c')
-rw-r--r--lib/initcall.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/initcall.c b/lib/initcall.c
index c8e2b0f6a38..2686b9aed5c 100644
--- a/lib/initcall.c
+++ b/lib/initcall.c
@@ -49,13 +49,14 @@ static int initcall_is_event(init_fnc_t func)
*/
int initcall_run_list(const init_fnc_t init_sequence[])
{
- ulong reloc_ofs = calc_reloc_ofs();
+ ulong reloc_ofs;
const init_fnc_t *ptr;
enum event_t type;
init_fnc_t func;
int ret = 0;
for (ptr = init_sequence; func = *ptr, func; ptr++) {
+ reloc_ofs = calc_reloc_ofs();
type = initcall_is_event(func);
if (type) {
@@ -84,7 +85,8 @@ int initcall_run_list(const init_fnc_t init_sequence[])
sprintf(buf, "event %d/%s", type,
event_type_name(type));
} else {
- sprintf(buf, "call %p", func);
+ sprintf(buf, "call %p",
+ (char *)func - reloc_ofs);
}
printf("initcall failed at %s (err=%dE)\n", buf, ret);