From: Simon Glass Date: Wed, 21 Dec 2022 23:08:22 +0000 (-0700) Subject: trace: Move trace pointer to data section X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=bebc1410ca79f5b8b33ca86b18bd55fd45d13185;p=u-boot.git trace: Move trace pointer to data section This can be written before relocation. Move it to the data section, since accessing BSS before relocation is not permitted. Signed-off-by: Simon Glass --- diff --git a/lib/trace.c b/lib/trace.c index 880d90ebd5..b9dc6d2e4b 100644 --- a/lib/trace.c +++ b/lib/trace.c @@ -40,7 +40,8 @@ struct trace_hdr { int max_depth; }; -static struct trace_hdr *hdr; /* Pointer to start of trace buffer */ +/* Pointer to start of trace buffer */ +static struct trace_hdr *hdr __section(".data"); static inline uintptr_t __attribute__((no_instrument_function)) func_ptr_to_num(void *func_ptr)