arm .data section variable align
Nick Clifton
nickc@redhat.com
Thu Jul 7 11:22:00 GMT 2005
Hi Michael,
> I have same problem width my arm toolchain for arm9tdmi.
This is a question about the behaviour of the gcc compiler for the
ARM target, so it should be addressed to the GCC mailing list and not
the binutils mailing list. The address for that list is:
gcc@gcc.gnu.org
> char x[10]={1,2,3,4,5,6,7,8,9,0};
> I have a misalign of x array. I'd want a 4 byte align for the data.
If you want 4 byte alignment for a char array you are going to have to
tell the compiler. By default char arrays have a single byte alignment.
Please have a look at the GCC documentation and in particular the
description of the __aligned__ attribute.
Cheers
Nick
More information about the Binutils
mailing list