Relocation in assembly
I have a boot-up code for a bare-metal ARM written in assembly and I'm trying to understand how it works. The binary is written in some external Flash, and is copying parts of itself in RAM at boot-up. I still didn't exactly get the concept of relocation in this context, even though I read this wikipedia entry . The RAM is mapped to a low address window, and the flash in a high address window. Can someone explain to me why we test the value of the link register here? /* Test if we are running from an address, we are not linked at */ bl check_position check_position: mov r0, lr ldr r1, =check