This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Reloc BUG in as


On 2 Mar 2001, Ian Lance Taylor wrote:

> Geoff Keating <geoffk@geoffk.org> writes:
> 
> > > Date: Fri, 2 Mar 2001 03:06:04 +0100 (CET)
> > > From: Mikulas Patocka <mikulas@artax.karlin.mff.cuni.cz>
> > > 
> > > Hi.
> > > 
> > > as sometimes does not create reloc entry. It is a bug. Tested on binutils
> > > 2.10.91.
> > 
> > Actually, it's the reverse, isn't it?  GAS should never create the
> > reloc for 'call a-b', since it can compute it correctly while assembling.
> 
> That is arguably true.  However, in that case gas needs to generate a
> call to the absolute address.  But it doesn't.  It generates a
> PC-relative call.

The real problem here is that

 call <absolute expression>

is not valid x86 assembly, where "valid 86 assembly" is as defined by
existing Unixware and other related AT&T derived x86 assemblers.

There was quite some discussion about this on the mailing lists (binutils
or gcc, I forget) around the time I made this patch:

1999-09-13  Alan Modra  <alan@spri.levels.unisa.edu.au>

	* config/tc-i386.c (md_assemble): Handle "jmp/call constant" as a
	pc-relative jmp/call to an absolute symbol.

> There are two correct options: 1) generate a call to the absolute
> address; 2) generate a PC-relative call with a relocation which the
> linker will resolve to the absolute address. 

or 3) Revert above patch (which was to work around a gcc bug as mush as
anyting else), and error out.

Alan
-- 
Linuxcare.  Support for the Revolution.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]