Calling equ'd symbols in GAS

H.J. Lu hjl.tools@gmail.com
Fri Aug 5 14:13:00 GMT 2011


On Thu, Aug 4, 2011 at 9:14 PM, Alan Modra <amodra@gmail.com> wrote:
> On Mon, Aug 01, 2011 at 12:29:17PM -0700, H.J. Lu wrote:
>>       * gas/i386/x86-64-branch.s: Add tests for direct branch.
>>       * gas/i386/x86-64-branch.d: Updated.
>>       * gas/i386/ilp32/x86-64-branch.d: Likewise.
>
> Needs tweaking.  eg. on x86_64-mingw32, I see
>
> regexp_diff match failure
> regexp "^[      ]*[a-f0-9]+:    e8 00 00 00 00          callq  0x1f     1b: R_X86_64_PC32       \*ABS\*\+0x10003c$"
> line   "  1a:   e8 5b 00 10 00          callq  10007a <.text+0x10007a>  1b: R_X86_64_PC32       *ABS*"
> regexp_diff match failure
> regexp "^[      ]*[a-f0-9]+:    e9 00 00 00 00          jmpq   0x24     20: R_X86_64_PC32       \*ABS\*\+0x10003c$"
> line   "  1f:   e9 60 00 10 00          jmpq   100084 <.text+0x100084>  20: R_X86_64_PC32       *ABS*"
> regexp_diff match failure
> regexp "^[      ]*[a-f0-9]+:    e8 00 00 00 00          callq  0x43     3f: R_X86_64_PC32       \*ABS\*\+0x10003c$"
> line   "  3e:   e8 7f 00 10 00          callq  1000c2 <.text+0x1000c2>  3f: R_X86_64_PC32       *ABS*"
> regexp_diff match failure
> regexp "^[      ]*[a-f0-9]+:    e9 00 00 00 00          jmpq   0x48     44: R_X86_64_PC32       \*ABS\*\+0x10003c$"
> line   "  43:   e9 84 00 10 00          jmpq   1000cc <.text+0x1000cc>  44: R_X86_64_PC32       *ABS*"
> FAIL: x86-64 indirect branch
>

I checked in this.

Thanks.

-- 
H.J.
-

diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index c6c0579..5154d36 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2011-08-05  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* gas/i386/x86-64-branch.d: Pass -dw to objdump and support
+	win64.
+
 2011-08-04  H.J. Lu  <hongjiu.lu@intel.com>

 	* gas/elf/bad-group.d: New.
diff --git a/gas/testsuite/gas/i386/x86-64-branch.d b/gas/testsuite/gas/i386/x86
-64-branch.d
index 428ce5b..fee2099 100644
--- a/gas/testsuite/gas/i386/x86-64-branch.d
+++ b/gas/testsuite/gas/i386/x86-64-branch.d
@@ -1,5 +1,5 @@
 #as: -J
-#objdump: -drw
+#objdump: -dw
 #name: x86-64 indirect branch

 .*: +file format .*
@@ -17,8 +17,8 @@ Disassembly of section .text:
 [ 	]*[a-f0-9]+:	66 ff e0             	jmpw   \*%ax
 [ 	]*[a-f0-9]+:	66 ff e0             	jmpw   \*%ax
 [ 	]*[a-f0-9]+:	66 ff 20             	jmpw   \*\(%rax\)
-[ 	]*[a-f0-9]+:	e8 00 00 00 00       	callq  0x1f	1b: R_X86_64_PC3
2	\*ABS\*\+0x10003c
-[ 	]*[a-f0-9]+:	e9 00 00 00 00       	jmpq   0x24	20: R_X86_64_PC3
2	\*ABS\*\+0x10003c
+[ 	]*[a-f0-9]+:	e8 (00|5b) 00 (00|10) 00       	callq  (0x1f|10007a <.te
xt\+0x10007a>)
+[ 	]*[a-f0-9]+:	e9 (00|60) 00 (00|10) 00       	jmpq   (0x24|100084 <.te
xt\+0x100084>)
 [ 	]*[a-f0-9]+:	ff d0                	callq  \*%rax
 [ 	]*[a-f0-9]+:	ff d0                	callq  \*%rax
 [ 	]*[a-f0-9]+:	66 ff d0             	callw  \*%ax
@@ -29,6 +29,6 @@ Disassembly of section .text:
 [ 	]*[a-f0-9]+:	66 ff e0             	jmpw   \*%ax
 [ 	]*[a-f0-9]+:	66 ff e0             	jmpw   \*%ax
 [ 	]*[a-f0-9]+:	66 ff 20             	jmpw   \*\(%rax\)
-[ 	]*[a-f0-9]+:	e8 00 00 00 00       	callq  0x43	3f: R_X86_64_PC3
2	\*ABS\*\+0x10003c
-[ 	]*[a-f0-9]+:	e9 00 00 00 00       	jmpq   0x48	44: R_X86_64_PC3
2	\*ABS\*\+0x10003c
+[ 	]*[a-f0-9]+:	e8 (00|7f) 00 (00|10) 00       	callq  (0x43|1000c2 <.te
xt\+0x1000c2>)
+[ 	]*[a-f0-9]+:	e9 (00|84) 00 (00|10) 00       	jmpq   (0x48|1000cc <.te
xt\+0x1000cc>)
 #pass



More information about the Binutils mailing list