This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Switch to turn off data alignment in arm-elf-gcc
- To: ecos-discuss at sources dot redhat dot com
- Subject: [ECOS] Switch to turn off data alignment in arm-elf-gcc
- From: "Lewin A.R.W. Edwards" <ledwards at digi-frame dot com>
- Date: Mon, 08 Jan 2001 14:36:19 -0500
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;
arm-elf-gcc will try to align the PARTENTRY structure on a 4-byte boundary
(0x1C0 offset). This is highly undesirable. I can work with
on-disk-structures using offsets inside raw dump arrays, but it's much
friendlier if I can use unions.
-- Lewin A.R.W. Edwards
Embedded Engineer, Digi-Frame Inc.
http://www.digi-frame.com/
Tel (914) 937-4090 9am-6:30pm M-F ET