FreeBSD arm EABI5 documentation?
adr
adr at SDF.ORG
Wed Jul 10 20:47:37 UTC 2019
On Wed, 10 Jul 2019, Ian Lepore wrote:
> That's... odd. The arm spec requires the stack to be 8-byte aligned at
> any public interface. It's hard to imagine how anything could work
> properly if it were not, given that the toolchains will assume that 64-
> bit values are aligned at 64-bit boundaries and will thus generate
> instructions that require that alignment (require it even if strict
> alignment checking for most instructions is disabled in the control
> register). If you could enter a function with the stack only 4-byte
> aligned, how would the compiler know it's safe to use something like an
> LDREXD instruction on a local variable allocated on the stack?
I have no idea. The only thing I can assure you is that in the code I'm
talking about (a forth implementation using SDL2) I've never aligned the
C stack when passing arguments to external functions. Until now!
More information about the freebsd-arm
mailing list