Skip to content

ARM: use r9 for gd instead of r8

Benoît Thébaudeau u-boot 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest0 of 3 patches 0 repliesNew

Patches in v1 No applies recorded yet

None of the 3 patches the cover letter announces are in this archive.

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [U-Boot] [PATCH 0/3] ARM: use r9 for gd instead of r8

Dear Jeroen Hofstee,

Quoted 3 lines · Jeroen Hofstee

To be EABI compliant (r9 is a platform specific register) and as a prepration for building u-boot with clang/llvm (with does / will support r9 as reserved register), store the pointer to gd in r9.

If r9 is reserved, I understand that its current usage may conflict with clang's but why would gd have to be stored in r9 for clang? Moreover, if r9 is reserved for clang (reserved for what?), why can it be used for gd?

I'm also wondering if r9 as initialized by relocate.S is not sometimes used by GCC to handle position-independent code within generated code, i.e. like the static base feature described for r9 as a possible usage in the ARM EABI AAPCS document (5.1.1). If this is the case, changing r9 to gd would break GCC code at runtime.

Best regards,
Beno?t