Jonathan Kinsey wrote:
Tim Prince wrote:
If your function gets a mis-aligned stack, that is not the fault of
gcc. However, if your gcc function passes a mis-aligned stack, when you
use the correct options, that is a bug.
gcc is more idealistic than commercial compilers which incur the
additional overhead of adjusting the stack everywhere it is needed.
Ok, but how can I fix it - the thread is created at the kernel level and
the initial thread function has a mis-aligned stack which gcc doesn't
correct. Do I need to add some assembly code to align the stack!?
This is my original point, even though your gcc function receives a
mis-aligned stack, with normal options, and correctly built binutils, it
should pass an aligned stack to its callee.