The current standard ARM EABI procedure call describes the standard "special" names for r12-r15:
- PC (r15): program counter
- LR (r14): reference register
- SP (r13): stack pointer
- IP (r12): intra-zero register *
GNU tools still support legacy obsolete APCS names as identifiers for given register numbers, although they no longer necessarily have what it means:
- FP (r11): frame pointer - may still be true for ARM code; Thumb code tends to keep the actual frame pointers in r7, and of course the code can be compiled without frame pointers at all, in which cases "fp" is just another general register registered with the chat.
- SL (r10): Stack restriction - I donβt really know the history of this, but in most modern codecs, r10 is no more special than r4-r8.
Note that r9 is not necessarily a general-purpose register - EABI reserves it for specific platform purposes. In linux-gnueabi, this is nothing special, but other platforms can use it for special purposes, such as a TLS pointer or a global object table, so it can also be replaced with SB (static base) or TR (stream register).
* Story that there is a limited range of branch instructions from the PC - if the linker finds that the call target ends in more than 32 MB, it can generate a veneer (some additional instructions within the range of the call site) as a branch target that calculates the real address and executes an absolute branch, which may require a zero register.
source share