This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


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

Switch to turn off data alignment in arm-elf-gcc


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


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