[PATCH] Fix IA-32 gas _GLOBAL_OFFSET_TABLE_ handling bugs (take 2)
Alan Modra
amodra@bigpond.net.au
Sun Aug 4 05:06:00 GMT 2002
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
More information about the Binutils
mailing list