This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Switch to turn off data alignment in arm-elf-gcc
- To: "Lewin A.R.W. Edwards" <ledwards at digi-frame dot com>
- Subject: Re: [ECOS] Switch to turn off data alignment in arm-elf-gcc
- From: Andrew Lunn <andrew dot lunn at ascom dot ch>
- Date: Tue, 9 Jan 2001 09:16:07 +0100
- Cc: ecos-discuss at sources dot redhat dot com
- References: <4.3.2.7.2.20010108143349.00a96b60@larwe.com>
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