Not sure what the reason is.
For example, default liker file already contains:
_stack_addr = ADDR(stack)+SIZEOF(stack);
_stack_end = ADDR(stack);
_heap_addr = ADDR(heap);
_heap_end = ADDR(heap)+SIZEOF(heap);
EXCEPTION_HANDLERS = ADDR(exception_handlers);
If I use any value like _stack_addr or EXCEPTION_HANDLERS in C file then it always works fine. Meaningless example:
extern uint32_t _stack_addr;
void test(void)
{
asm ("lis r5, _stack_addr@h");
...
}
Lukas