This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: IA-32 gas _GLOBAL_OFFSET_TABLE_ handling bugs
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: binutils at sources dot redhat dot com, roland at redhat dot com
- Date: Thu, 1 Aug 2002 10:42:18 +0930
- Subject: Re: IA-32 gas _GLOBAL_OFFSET_TABLE_ handling bugs
- References: <20020731152058.M20867@sunsite.ms.mff.cuni.cz>
On Wed, Jul 31, 2002 at 03:20:58PM +0200, Jakub Jelinek wrote:
> movl $_GLOBAL_OFFSET_TABLE_+[.-test], _GLOBAL_OFFSET_TABLE_
That's an interesting one.
> 4b: c7 05 00 00 00 00 4d movl $0x4d,0x0
> 52: 00 00 00
> 4d: R_386_GOTPC _GLOBAL_OFFSET_TABLE_
> 51: R_386_GOTPC _GLOBAL_OFFSET_TABLE_
Quite wrong. The first reloc should be R_386_32. This code in
tc_gen_reloc needs extra checks as per output_imm.
if (code == BFD_RELOC_32
&& GOT_symbol
&& fixp->fx_addsy == GOT_symbol)
{
/* We don't support GOTPC on 64bit targets. */
if (flag_code == CODE_64BIT)
abort ();
code = BFD_RELOC_386_GOTPC;
}
--
Alan Modra
IBM OzLabs - Linux Technology Centre