[ECOS] Switch to turn off data alignment in arm-elf-gcc
Andrew Lunn
andrew.lunn@ascom.ch
Tue Jan 9 00:16:00 GMT 2001
On Mon, Jan 08, 2001 at 02:36:19PM -0500, Lewin A.R.W. Edwards wrote:
> I'm SURE this is an RTFM but I can't find this in the man page... what is
> the command-line switch to turn off structure alignment in arm-elf-gcc? For
> example in the following structure:
>
> // Master Boot Record
> typedef struct {
> unsigned char fill[0x1be]; // boot code
> PARTENTRY partitions[4]; // partition table
> unsigned char sig_55; // 55h boot signature
> unsigned char sig_aa; // AAh boot signature
> } MBR, *PMBR;
You need to add
__attribute__ ((packed))
to the end of the declaration.
Its documented in the gcc info pages. Look at the section, "Specifying
Attributes of Types"
Andrew
More information about the Ecos-discuss
mailing list