This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: arm .data section variable align
- From: Nick Clifton <nickc at redhat dot com>
- To: Michael Trimarchi <trimarchi at gandalf dot sssup dot it>
- Cc: binutils at sources dot redhat dot com
- Date: Thu, 07 Jul 2005 12:26:10 +0100
- Subject: Re: arm .data section variable align
- References: <42CCE867.9070305@gandalf.sssup.it>
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