When i look through u-boot source code, i found that it pass global data through r9 register like this
register volatile gd_t *gd asm ("r9")
So, i'm curious, how does u-boot ensure further codes won't use r9 register and corrupt the global data. Is there an options to tell compiler not to use specific register?
From Procedure Call Standard for the ARM Architecture:
Yet GCC doesn't have a abi profile for reserving
r9
for platform usage thus the way u-boot does this is with -ffixed-r9 option.