Aligment of data in .text and .data section (Intel/Linux)

Alan Modra amodra@bigpond.net.au
Tue Jul 31 17:44:00 GMT 2001


On Tue, Jul 31, 2001 at 05:16:06PM +0200, Frank Klemm wrote:
> 
> How can I EXPLICITELY select an section alignment without patching the *.o
> files? Automatics are fine, I only need a switch to turn them of.

As far as I know, you can't decrease the alignment of an input section.

Your options are:
a) Use different section names.  Note that the end of a section
   is padded out according to the alignment, so this may not work very
   well if you're trying to tack things on to the end of compiler
   generated code in .text.  Also, you might need to set section
   attributes (ie. mark your sections executable) for this to work,
   or play with linker scripts.
b) Patch the assembler.  Hint: grep for record_alignment.

Alan



More information about the Binutils mailing list