This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [patch] fix for offset operands in i386 intel syntax
On Sat, 16 Dec 2000, Alan Modra wrote:
> On Fri, 15 Dec 2000, Diego Novillo wrote:
>
> > How do I configure GAS for all the different binary flavours
> > (a.out, elf, etc).
>
> I configure with --target=i686-linux --enable-targets=i386-linuxaout,i386-coff
> then "export AS_EMULATION=i386aout" before running the testsuite. Ignore
> the elf errors - the testsuite isn't sophisticated enough to know about
> emulations.
>
OK, thanks. But now intel.s doesn't assemble because of
unsupported relocations (the GOT references). Is this what you
were referring to? I'm getting the following:
-----------------------------------------------------------------------------
../as-new -J -o dump.o /home/dnovillo/binutils/src/gas/testsuite/gas/i386/intel.s
/home/dnovillo/binutils/src/gas/testsuite/gas/i386/intel.s: Assembler messages:
/home/dnovillo/binutils/src/gas/testsuite/gas/i386/intel.s:579: Error: cannot represent relocation type BFD_RELOC_386_GOTOFF
/home/dnovillo/binutils/src/gas/testsuite/gas/i386/intel.s:619: Error: cannot represent relocation type BFD_RELOC_386_GOT32
/home/dnovillo/binutils/src/gas/testsuite/gas/i386/intel.s:623: Error: cannot represent relocation type BFD_RELOC_386_GOTPC
FAIL: i386 intel
-----------------------------------------------------------------------------
> > The patch also adds a new test to intel.s but
> > I'm not sure if I need to pad with nops for a.out.
>
> You will need to, as the file doesn't end on a 4 byte boundary. Why not
> fix it once and for all by adding
> .p2align 4,0
> at the end of intel.s. 16 byte alignment is a bit excessive, but doesn't
> hurt.
>
Like this?
Index: intel.d
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/i386/intel.d,v
retrieving revision 1.7
diff -d -c -p -r1.7 intel.d
*** intel.d 2000/12/11 21:49:36 1.7
--- intel.d 2000/12/16 05:42:53
*************** Disassembly of section .text:
*** 623,625 ****
--- 623,630 ----
a78: e9 55 ff ff ff [ ]*jmp 9d2 <bar>
a7d: 8b 83 (00 00|d0 09) 00 00 [ ]*mov (0x0|0x9d0)\(%ebx\),%eax
a83: 90 [ ]*nop[ ]*
+ a84: 5b [ ]*pop %ebx
+ a85: 81 c3 03 00 00 00 [ ]*add \$0x3,%ebx
+ a8b: 00 00 [ ]*add %al,\(%eax\)
+ a8d: 00 00 [ ]*add %al,\(%eax\)
+ \.\.\.
Index: intel.s
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/i386/intel.s,v
retrieving revision 1.7
diff -d -c -p -r1.7 intel.s
*** intel.s 2000/12/11 21:49:36 1.7
--- intel.s 2000/12/16 05:42:53
*************** rot5:
*** 618,620 ****
--- 618,624 ----
jmp bar
mov eax, DWORD PTR gs_foo@GOT[ebx]
nop
+ .L23:
+ pop %ebx
+ add %ebx, OFFSET FLAT:_GLOBAL_OFFSET_TABLE_+[.-.L23]
+ .p2align 4,0