This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [PATCH] Fix IA-32 gas _GLOBAL_OFFSET_TABLE_ handling bugs (take 2)
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Roland McGrath <roland at redhat dot com>, binutils at sources dot redhat dot com, drow at mvista dot com
- Date: Sun, 4 Aug 2002 21:36:16 +0930
- Subject: Re: [PATCH] Fix IA-32 gas _GLOBAL_OFFSET_TABLE_ handling bugs (take 2)
- References: <20020731152058.M20867@sunsite.ms.mff.cuni.cz> <20020801005632.GH12579@bubble.sa.bigpond.net.au> <20020731183115.J15334@redhat.sf.frob.com> <20020801023818.GM12579@bubble.sa.bigpond.net.au> <20020802214724.G20867@sunsite.ms.mff.cuni.cz> <20020802130103.B32198@redhat.sf.frob.com> <20020803225151.R20867@sunsite.ms.mff.cuni.cz>
On Sat, Aug 03, 2002 at 10:51:51PM +0200, Jakub Jelinek wrote:
> * config/tc-i386.c (output_insn): Save frag_now and frag_now_fix ()
> at start of insn, pass it to output_disp and output_imm.
> (output_disp): Added arguments. If _GLOBAL_OFFSET_TABLE_ is seen
> in displacement for R_386_32 reloc, use R_386_GOTPC and compute
> properly addend.
> (output_imm): Added arguments. Compute properly addend for
> R_386_GOTPC.
> (md_apply_fix3): Remove R_386_GOTPC handling.
> * testsuite/gas/i386/gotpc.s: New.
> * testsuite/gas/i386/gotpc.d: New.
> * testsuite/gas/i386/i386.exp: Add gotpc test.
OK, but..
> + leal _GLOBAL_OFFSET_TABLE+[.-test](%eax), %ebx
> + leal _GLOBAL_OFFSET_TABLE+[.-test](%ebx), %eax
> + leal _GLOBAL_OFFSET_TABLE+[.-test](%eax), %eax
> + leal _GLOBAL_OFFSET_TABLE+[.-test](%ebx), %ebx
Fix the symbol please.
> @@ -53,6 +53,7 @@ if [expr ([istarget "i*86-*-*"] || [ist
> run_dump_test "jump"
> run_dump_test "ssemmx2"
> run_dump_test "sse2"
> + run_dump_test "gotpc"
And this needs to be ELF only.
> # PIC is only supported on ELF targets.
> if { ([istarget "*-*-elf*"] || [istarget "*-*-linux*"] )
--
Alan Modra
IBM OzLabs - Linux Technology Centre