Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 May 2002 22:20:48 -0700
From:      Jonathan Mini <mini@freebsd.org>
To:        "E.B. Dreger" <eddy+public+spam@noc.everquick.net>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: any file --> symbol in .o file
Message-ID:  <20020519222048.L25907@stylus.haikugeek.com>
In-Reply-To: <Pine.LNX.4.20.0205200446080.9505-100000@www.everquick.net>; from eddy%2Bpublic%2Bspam@noc.everquick.net on Mon, May 20, 2002 at 04:54:41AM %2B0000
References:  <20020519214105.K25907@stylus.haikugeek.com> <Pine.LNX.4.20.0205200446080.9505-100000@www.everquick.net>

next in thread | previous in thread | raw e-mail | index | archive | help
E.B. Dreger [eddy+public+spam@noc.everquick.net] wrote :

> I guess I'll run with that for now.  Off the top of my head, the
> only feature file2c can't provide is user-specified data
> alignment.  (Unless, of course, someone corrects me and alerts me
> to a C preprocessor directive similar to assembly's ".align".)
> 

How about putting the aligned data into a structure? gcc will align the
fields of the structure intelligenetly, at least. You'll need to put 
padding on the end of the structure so that each struct will be properly
aligned, but that's no big deal. Gcc will do the right thing when it
sees a large const like that, and align the whole thing in .data.

If you want specific aligment, you could then use gcc's __alignment__((n))
attribute. It's not portable, but the same alignment doesn't always make
sense on different platforms anyways.

-- 
Jonathan Mini <mini@freebsd.org>
http://www.haikugeek.com

"He who is not aware of his ignorance will be only misled by his knowledge."
                                                        -- Richard Whatley

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020519222048.L25907>