delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/05/22/09:56:32

From: Andrew Crabtree <andrewc AT typhoon DOT rose DOT hp DOT com>
Message-Id: <199705221354.AA027439296@typhoon.rose.hp.com>
Subject: Re: -m486 alignment problem
To: Robert DOT Hoehne AT Mathematik DOT tu-chemnitz DOT de (Robert Hoehne)
Date: Thu, 22 May 1997 6:54:56 PDT
Cc: djgpp AT delorie DOT com
In-Reply-To: <3384077E.380C39D7@Mathematik.tu-chemnitz.de>; from "Robert Hoehne" at May 22, 97 10:44 am

 
> > I tried compiling the following code bit with gcc and pgcc to see what
> > alignment they would use (they are different).
> 
> Then they are different configured.

The PCG group told me that PGCC will only support byte alignment.  This
may be true of regula gcc (2.8) now also (I'll follow up)

> >  Since old versions of
> > gas used power of 2 aligning, and new versions use byte aligning
> > (so I've been told),
> 
> Who told this to you?

Marc Lehman.  I'll forward him a copy for his thoughts.

> 
> OK, since I ported binutils 2.7 and now working on binutils 2.8
> here some remarks:
> 
> - In the first beta stage when porting binutils 2.7 I had
>   the problem, how gas should handle the '.align' directives
>   produced by gcc. I asked DJ and he told me, that we are
>   using on DJGPP the meaning as the alignment of the power
>   of 2 (that means, '.align 2' is treated as an alignment
>   on a 4-byte boundary).

DJ did not seem to represent this to me in a recent post (not disagree,
just not a specific answer).  He said 
go through by trial and error and see what we are doing currently.

> - Since there is nowhere an exact specification (or does
>   it exist and I don't know where?) I made the above mentioned
>   behaviour of gas and I will do it also for gas 2.8

I've seen somewhere in the docs I belive that 'standard' behavious is 
byte alignment.  However, for some cpus (the i386 one of them), 'standard'
is power of 2.

> And a last note: Think a little bit about the following fact.
> Until this time nobody has complained something about a
> misinterpreting of the alignment, which means until now
> everything was OK. Only with the new pgcc there are problems.
> >From this (I think) follows directly, that the error is
> in pgcc and nothing else.

I'm not sure about this, as evidenced by the section in Eli's FAQ 
detailing problems with gcc and gas misinterpreting alignment causing
slow performance on a pentium.  As long as GCC and AS agree on alignment
then there is no problem.  I have no qualm with releasing a separate
version of AS that uses byte alignment for pgcc if its needed.  I am 
confused though as why alignment for DJs gcc would have been changed.
At least I think it must have been changed.  When I built my cross-compiler
and cross-assembler on HPUX they both used byte alignment, and this 
required no special configuration on my part (modifying of header files
and whatnot).  Also, the AS.EXE that I just made available was built 
without any modifications at all.  Just let configure do its job and 
then make.

My intent here was not to start an argument as to which was better.  Merely
to understand what kind of alignment the original as.exe uses, and provide 
a replacement if needed.


Andrew





- Raw text -


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