0

How do I make the functions align at 4-byte boundaries with GCC, target 680x0?

-malign-functions=4 does not seem to do the trick, by itself anyway. Some kind of option meant to improve cache performance on 68020 and up perhaps?

2 Answers 2

3

-malign-functions=4 should do the trick but it can be overridden with the function attribute aligned(). Make sure that your code doesn't use this (for example with a macro).

Sign up to request clarification or add additional context in comments.

3 Comments

Something for AROS contrib if it works I think. :-) Anyway, no aligned attribute to be seen, besides I don't think that version of GCC supports that attribute. (Too old.) Do you think that it could be the linker which proceeds to misalign the code?
Been a while since I looked into the AROS source code :-( Is that PIC code? Otherwise, it's unlikely that the linker can interfere. Try "gcc -s" to get the assembly output and look for the .align meta-ops.
Don't know what it is actually, but good point about the PIC or not, makes sense. Thanks for the gcc -s tip, will try that when I get home. Thank you for creating AROS, that thing is finally shaping up the way I dreamt of in 1997, with Amiga hardware and software clones and AROS running on m68k. :-)
1

Try using this:

( Quoted from linux.die )

-m4byte-functions

F-mno-4byte-functions

Force all functions to be aligned to a four byte boundary.

3 Comments

-mNO-4byte-functions - Interesting choice of name!
Haha, will try this later. :-)
Hm, while an interesting answer, it's not relevant to the 68000 line of processors. Quoting from Wikipedia "The M·CORE instruction set is very different from the 68K instruction set" en.wikipedia.org/wiki/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.