www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/04/28/13:41:40

Date: Wed, 28 Apr 1999 18:41:29 +0100
From: cmatraki AT ee DOT ucl DOT ac DOT uk (Chris Matrakidis)
Message-Id: <199904281741.SAA12760@melchard.ee.ucl.ac.uk>
To: djgpp-workers AT delorie DOT com
Subject: Re: [dma AT hpesdma DOT fc DOT hp DOT com: Performance Observation]
X-Sun-Charset: US-ASCII
Reply-To: djgpp-workers AT delorie DOT com

> 8-byte alignment is my vote.  Note that a global alignment is wrong,
> because ctor/dtor tables will get corrupted if they're padded.
> 
I still think that thre should be at least 16-byte alignment.
egcs which will try to maintain the 16-byte alignment in the .text section
for jumps and loops when compiling with -m486.

And there shouldn't be any problem with ctor/dtor tables. From 
binutils-2.8.1/bfd/coffcode.h:

  /* The .stab section must be aligned to 2**2 at most, because
     otherwise there may be gaps in the section which gdb will not
     know how to interpret.  Examining the section name is a hack, but
     that is also how gdb locates the section.
     We need to handle the .ctors and .dtors sections similarly, to
     avoid introducing null words in the tables.  */
  if (COFF_DEFAULT_SECTION_ALIGNMENT_POWER > 2
      && (strncmp (section->name, ".stab", 5) == 0
	  || strcmp (section->name, ".ctors") == 0
	  || strcmp (section->name, ".dtors") == 0))
    section->alignment_power = 2;

  /* Similarly, the .stabstr section must be aligned to 2**0 at most.  */
  if (COFF_DEFAULT_SECTION_ALIGNMENT_POWER > 0
      && strncmp (section->name, ".stabstr", 8) == 0)
    section->alignment_power = 0;

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019