This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: RFC: PATCH: PR gas/12049: Unnecessary relaxation
On 25/10/2010 10:19, H.J. Lu wrote:
> * gas/i386/i386.exp: Run relax-1 and relax-2 for all 32bit
> targets. Run x86-64-relax-1.
The relax-1 and relax-2 tests fail on i686-pc-cygwin, because the objdump
output has labels in it, and no "0x" prefix on the immediates:
> $ /gnu/binutils/obj/gas/testsuite/../../binutils/objdump -d dump.o
>
> dump.o: file format pe-i386
>
>
> Disassembly of section .text:
>
> 00000000 <.text>:
> 0: 90 nop
> 1: 90 nop
[ ... snip ... ]
> d: 90 nop
> e: e9 8d 00 00 00 jmp a0 <.text+0xa0>
> 13: 90 nop
... while the dump script files don't:
> $ cat /gnu/binutils/src/gas/testsuite/gas/i386/relax-1.d
> #name: i386 relax 1
> #objdump: -dw
>
> .*: +file format .*
>
>
> Disassembly of section .text:
>
> 0+ <.text>:
> #...
> e: e9 8d 00 00 00 jmp 0xa0
> #...
> 21: eb 7d jmp 0xa0
> #...
> a0: 90 nop
> #pass
The attached patch makes it pass on i686-pc-cygwin, and I checked on
i686-pc-linux-gnu (both native and cross to x86_64-pc-linux-gnu) that it
didn't break the test there. OK?
gas/testsuite/ChangeLog:
* i386/relax-1.d: Generalize regexes a bit.
* i386/relax-2.d: Likewise.
cheers,
DaveK
Index: gas/testsuite/gas/i386/relax-1.d
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/i386/relax-1.d,v
retrieving revision 1.1
diff -p -u -r1.1 relax-1.d
--- gas/testsuite/gas/i386/relax-1.d 19 Oct 2010 17:13:30 -0000 1.1
+++ gas/testsuite/gas/i386/relax-1.d 26 Oct 2010 16:00:12 -0000
@@ -8,9 +8,9 @@ Disassembly of section .text:
0+ <.text>:
#...
- e: e9 8d 00 00 00 jmp 0xa0
+ e: e9 8d 00 00 00 jmp (0x)?a0( .*)?
#...
- 21: eb 7d jmp 0xa0
+ 21: eb 7d jmp (0x)?a0( .*)?
#...
a0: 90 nop
#pass
Index: gas/testsuite/gas/i386/relax-2.d
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/i386/relax-2.d,v
retrieving revision 1.1
diff -p -u -r1.1 relax-2.d
--- gas/testsuite/gas/i386/relax-2.d 19 Oct 2010 17:13:30 -0000 1.1
+++ gas/testsuite/gas/i386/relax-2.d 26 Oct 2010 16:00:12 -0000
@@ -8,9 +8,9 @@ Disassembly of section .text:
0+ <.text>:
#...
- 38: 0f 85 88 00 00 00 jne 0xc6
+ 38: 0f 85 88 00 00 00 jne (0x)?c6( .*)?
#...
- 48: 75 7c jne 0xc6
+ 48: 75 7c jne (0x)?c6( .*)?
#...
c6: 90 nop
#pass