This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: arm .data section variable align


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]