www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/07/07/09:04:20

Sender: root AT delorie DOT com
Message-ID: <37835347.3DBA1C7A@inti.gov.ar>
Date: Wed, 07 Jul 1999 10:16:55 -0300
From: salvador <salvador AT inti DOT gov DOT ar>
Organization: INTI
X-Mailer: Mozilla 4.6 [en] (X11; I; Linux 2.0.36 i686)
X-Accept-Language: es-AR, en, es
MIME-Version: 1.0
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
CC: djgpp-workers AT delorie DOT com, DJ Delorie <dj AT delorie DOT com>
Subject: Re: .align directives in libc.a
References: <Pine DOT SUN DOT 3 DOT 91 DOT 990707151540 DOT 2851G-100000 AT is>
Reply-To: djgpp-workers AT delorie DOT com

Eli Zaretskii wrote:

> On Tue, 6 Jul 1999, salvador wrote:
>
> > I added a special section to my link configuration file (djgpp.djl?). This
> > section is very well aligned and I put special functions there.
> > What about including it in 2.03 so we can experiment?
>
> Why don't we simply do it by default?  I don't like the idea of putting
> this into djgpp.djl, since that file is distributed with Binutils, but
> we could configure Binutils to align all sections better then they do
> now.

These are 2 things totally different. My question is: Do we really want to use
16 bytes between functions for libc? What if the user wants 32?
For that we need a section named different than .text.
What we could change in binutils is the aligment between .o files which, in the
particular case of libc, will be almost the aligment between functions. The
aligment between functions can be controlled from gcc or just by hand (using
macros for example), the aligment between .o files seems to be hardcoded in ld
and hard to fix due to limitations in COFF format.
Now if we want to not bloat libc, stick with COFF and allow users to align
better than the aligment in libc we *must* provide an alternative section to do
it. This must be standard or people will name it with personal names (like I
did) to avoid collisions and will create incompatibility.

> > > The Intel manuals seem to indicate that optimal alignment of code is
> > > also 16 bytes, at least for the targets of call/jmp instructions under
> > > some circumstances.  Again, unless the code section is 16-byte
> > > aligned, no clever use of .align by the code will ever be able to
> > > achieve that.
> >
> > Sections should be aligned to 32 bytes at least.
>
> Why?  At least for the data sections, 8 bytes seem to be enough: only
> long double variables need more.

According to gcc manual a section is .data, .text, etc. If you start with an
aligment of less than 32 bytes (and that's only the start of the section, not
all the objects inside) nobody will be able to use 32 bytes aligment on it.
I think currently .text have more than 32 bytes aligment, and the data section
about 512.

SET

--
Salvador Eduardo Tropea (SET). (Electronics Engineer)
Visit my home page: http://welcome.to/SetSoft or
http://www.geocities.com/SiliconValley/Vista/6552/
Alternative e-mail: set-soft AT usa DOT net set AT computer DOT org
                    set AT ieee DOT org set-soft AT bigfoot DOT com
Address: Curapaligue 2124, Caseros, 3 de Febrero
Buenos Aires, (1678), ARGENTINA Phone: +(5411) 4759 0013



- Raw text -


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