arm-elf-gcc : change default data alignement depending on ARM/THUMB

Vincent Rubiolo vincent.rubiolo@st.com
Thu Aug 21 08:52:00 GMT 2003


Dear all,

I am trying to figure out why gcc always aligns on 4 bytes boundaries (32 bits) 
on arm-elf-gcc in an attempt to reduce code footprint. I found that GCC produces 
much bigger code than ADS (30 to 50 %) when ARM and THUMB are mixed 
(interworking enabled) on our project.

It indeed seems that ARM ADS 1.2 aligns on halfwords (16 bits) when in THUMB 
mode (along with much more sophisticated rules). GCC different behavior causes 
much more padding to be inserted in structs members and, as the project I work 
on uses HW mapped registers, application crashes.
For now, I worked around that using a compile time define to enable the 
__attribute((packed))__ on the struct(s). I would nevertheless like to know 
whether there is another solution.

I am also digging into the arm.h and arm.c files (thanks to the gcc's internal 
manual) to try to change the alignment behavior.

Could you give me other ideas/solutions on that point?

Thanks for your consideration,

Vincent


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com



More information about the crossgcc mailing list