This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Reloc BUG in as
- To: Ian Lance Taylor <ian at zembu dot com>
- Subject: Re: Reloc BUG in as
- From: Alan Modra <alan at linuxcare dot com dot au>
- Date: Sun, 4 Mar 2001 15:33:19 +1100 (EST)
- cc: Geoff Keating <geoffk at redhat dot com>, mikulas at artax dot karlin dot mff dot cuni dot cz, binutils at sources dot redhat dot com
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.