www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/10/06/07:37:03

Date: Tue, 6 Oct 1998 14:36:24 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: djgpp-workers AT delorie DOT com
Subject: Default alignment
Message-ID: <Pine.SUN.3.91.981006143516.17118Y-100000@is>
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com

If I understand correctly the message by Ian Taylor (below), it would
be a good idea to define COFF_DEFAULT_SECTION_ALIGNMENT_POWER to make
executable be aligned on more than 4 bytes (is 8 okay for a Pentium?), 
unless [34]86 will be somehow punished by that.

Alternatively, we could change lib/specs to make GCC pass alignment
options to ld when -mpentium or such likes are use, but I don't see
any options to ld that can be used for that.  Did I miss something?

Btw, is somebody still working on porting Binutils 2.9?

> Date: Sun, 4 Oct 1998 01:00:44 -0400
> From: Ian Lance Taylor <ian AT cygnus DOT com>
> CC: bug-gnu-utils AT gnu DOT org
> Resent-From: bug-gnu-utils AT gnu DOT org
> X-Mailing-List: <bug-gnu-utils AT gnu DOT org> archive/latest/3527
> X-Loop: bug-gnu-utils AT gnu DOT org
> Precedence: list
> Resent-Sender: bug-gnu-utils-request AT gnu DOT org
> Content-Type: text
> Content-Length: 1080
> 
>    Date: Sat, 03 Oct 1998 22:56:07 +0200
>    From: Erik Sandberg <eriksandberg AT geocities DOT com>
> 
>    I'm using DJGPP v2.01 (the i386 port for MS-DOS), with the pre-compiled
>    binaries from ftp://ftp.sunet.se/pub/simtelnet/gnu/djgpp/ (or a mirror). I
>    guess they are compiled with v2.8.1. My problem is that it's impossible to
>    align a symbol by more than four, since all symbol alignments are relative
>    to the subsection, that only is aligned by four. The latest Intel x86
>    processors are very sensitive to alignment, for example access to 64-bit
>    variables can be about ten times slower if it's misaligned.
> 
> This is a deficiency in the COFF object file format.  It has no way to
> record the desired alignment.  The GNU linker gives all COFF sections
> the same default alignment.  On the i386, as you've seen, it aligns
> all sections to a four byte boundary.
> 
> There is no simple solution to this problem.  ELF does not have this
> deficiency.
> 
> The default alignment for a section in an i386 COFF file is defined by
> COFF_DEFAULT_SECTION_ALIGNMENT_POWER in bfd/coff-i386.c.
> 
> Ian

- Raw text -


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