aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-i386
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@redhat.com>2022-05-26 13:11:11 +0100
committerAndrew Burgess <aburgess@redhat.com>2022-05-27 14:12:33 +0100
commit202be274a41a912f705141d9fb3574f4b0d415e1 (patch)
treeb916bd95dbcd7f04fd60a4c58712642740fc4ace /ld/testsuite/ld-i386
parent601598589589734c21bacfc00cd4aed4f3fd1a1f (diff)
downloadgdb-202be274a41a912f705141d9fb3574f4b0d415e1.zip
gdb-202be274a41a912f705141d9fb3574f4b0d415e1.tar.gz
gdb-202be274a41a912f705141d9fb3574f4b0d415e1.tar.bz2
opcodes/i386: remove trailing whitespace from insns with zero operands
While working on another patch[1] I had need to touch this code in i386-dis.c: ins->obufp = ins->mnemonicendp; for (i = strlen (ins->obuf) + prefix_length; i < 6; i++) oappend (ins, " "); oappend (ins, " "); (*ins->info->fprintf_styled_func) (ins->info->stream, dis_style_mnemonic, "%s", ins->obuf); What this code does is add whitespace after the instruction mnemonic and before the instruction operands. The problem I ran into when working on this code can be seen by assembling this input file: .text nop retq Now, when I disassemble, here's the output. I've replaced trailing whitespace with '_' so that the issue is clearer: Disassembly of section .text: 0000000000000000 <.text>: 0: 90 nop 1: c3 retq___ Notice that there's no trailing whitespace after 'nop', but there are three spaces after 'retq'! What happens is that instruction mnemonics are emitted into a buffer instr_info::obuf, then instr_info::mnemonicendp is setup to point to the '\0' character at the end of the mnemonic. When we emit the whitespace, this is then added starting at the mnemonicendp position. Lets consider 'retq', first the buffer is setup like this: 'r' 'e' 't' 'q' '\0' Then we add whitespace characters at the '\0', converting the buffer to this: 'r' 'e' 't' 'q' ' ' ' ' ' ' '\0' However, 'nop' is actually an alias for 'xchg %rax,%rax', so, initially, the buffer is setup like this: 'x' 'c' 'h' 'g' '\0' Then in NOP_Fixup we spot that we have an instruction that is an alias for 'nop', and adjust the buffer to this: 'n' 'o' 'p' '\0' '\0' The second '\0' is left over from the original buffer contents. However, when we rewrite the buffer, we don't afjust mnemonicendp, which still points at the second '\0' character. Now, when we insert whitespace we get: 'n' 'o' 'p' '\0' ' ' ' ' ' ' ' ' '\0' Notice the whitespace is inserted after the first '\0', so, when we print the buffer, the whitespace is not printed. The fix for this is pretty easy, I can change NOP_Fixup to adjust mnemonicendp, but now a bunch of tests start failing, we now produce whitespace after the 'nop', which the tests don't expect. So, I could update the tests to expect the whitespace.... ...except I'm not a fan of trailing whitespace, so I'd really rather not. Turns out, I can pretty easily update the whitespace emitting code to spot instructions that have zero operands and just not emit any whitespace in this case. So this is what I've done. I've left in the fix for NOP_Fixup, I think updating mnemonicendp is probably a good thing, though this is not really required any more. I've then updated all the tests that I saw failing to adjust the expected patterns to account for the change in whitespace. [1] https://sourceware.org/pipermail/binutils/2022-April/120610.html
Diffstat (limited to 'ld/testsuite/ld-i386')
-rw-r--r--ld/testsuite/ld-i386/align-branch-1.d2
-rw-r--r--ld/testsuite/ld-i386/code16.d2
-rw-r--r--ld/testsuite/ld-i386/ibt-plt-1.d12
-rw-r--r--ld/testsuite/ld-i386/ibt-plt-2a.d12
-rw-r--r--ld/testsuite/ld-i386/ibt-plt-2c.d12
-rw-r--r--ld/testsuite/ld-i386/ibt-plt-3a.d12
-rw-r--r--ld/testsuite/ld-i386/ibt-plt-3c.d12
-rw-r--r--ld/testsuite/ld-i386/pr20244-2a.d4
-rw-r--r--ld/testsuite/ld-i386/pr20244-4a.d4
-rw-r--r--ld/testsuite/ld-i386/pr23930.d2
-rw-r--r--ld/testsuite/ld-i386/pr26018.d2
-rw-r--r--ld/testsuite/ld-i386/pr26263.d2
-rw-r--r--ld/testsuite/ld-i386/pr27193.dd2
-rw-r--r--ld/testsuite/ld-i386/protected2.d4
-rw-r--r--ld/testsuite/ld-i386/protected3.d2
-rw-r--r--ld/testsuite/ld-i386/protected7.d2
-rw-r--r--ld/testsuite/ld-i386/tlspie3b.d6
-rw-r--r--ld/testsuite/ld-i386/tlspie3c.d6
18 files changed, 50 insertions, 50 deletions
diff --git a/ld/testsuite/ld-i386/align-branch-1.d b/ld/testsuite/ld-i386/align-branch-1.d
index 8c62ee4..762435a 100644
--- a/ld/testsuite/ld-i386/align-branch-1.d
+++ b/ld/testsuite/ld-i386/align-branch-1.d
@@ -20,5 +20,5 @@ Disassembly of section .text:
+[a-f0-9]+: 3e 3e 3e 8b 90 fc ff ff ff ds ds mov %ds:-0x4\(%eax\),%edx
+[a-f0-9]+: 85 d2 test %edx,%edx
+[a-f0-9]+: 74 00 je +[a-f0-9]+ <_start\+0x24>
- +[a-f0-9]+: c3 ret
+ +[a-f0-9]+: c3 ret
#pass
diff --git a/ld/testsuite/ld-i386/code16.d b/ld/testsuite/ld-i386/code16.d
index 8b67861..c44fb03 100644
--- a/ld/testsuite/ld-i386/code16.d
+++ b/ld/testsuite/ld-i386/code16.d
@@ -10,7 +10,7 @@
Disassembly of section .text.default_process_op.isra.0:
0+737c <default_process_op.isra.0>:
- +[a-f0-9]+: 66 c3 retl
+ +[a-f0-9]+: 66 c3 retl
Disassembly of section .text.mpt_scsi_process_op:
diff --git a/ld/testsuite/ld-i386/ibt-plt-1.d b/ld/testsuite/ld-i386/ibt-plt-1.d
index b0648ae..b5e1e6e 100644
--- a/ld/testsuite/ld-i386/ibt-plt-1.d
+++ b/ld/testsuite/ld-i386/ibt-plt-1.d
@@ -11,11 +11,11 @@ Disassembly of section .plt:
+[a-f0-9]+: ff b3 04 00 00 00 push 0x4\(%ebx\)
+[a-f0-9]+: ff a3 08 00 00 00 jmp \*0x8\(%ebx\)
+[a-f0-9]+: 0f 1f 40 00 nopl 0x0\(%eax\)
- +[a-f0-9]+: f3 0f 1e fb endbr32
+ +[a-f0-9]+: f3 0f 1e fb endbr32
+[a-f0-9]+: 68 00 00 00 00 push \$0x0
+[a-f0-9]+: e9 e2 ff ff ff jmp [a-f0-9]+ <bar1@plt-0x30>
+[a-f0-9]+: 66 90 xchg %ax,%ax
- +[a-f0-9]+: f3 0f 1e fb endbr32
+ +[a-f0-9]+: f3 0f 1e fb endbr32
+[a-f0-9]+: 68 08 00 00 00 push \$0x8
+[a-f0-9]+: e9 d2 ff ff ff jmp [a-f0-9]+ <bar1@plt-0x30>
+[a-f0-9]+: 66 90 xchg %ax,%ax
@@ -23,12 +23,12 @@ Disassembly of section .plt:
Disassembly of section .plt.sec:
[a-f0-9]+ <bar1@plt>:
- +[a-f0-9]+: f3 0f 1e fb endbr32
+ +[a-f0-9]+: f3 0f 1e fb endbr32
+[a-f0-9]+: ff a3 0c 00 00 00 jmp \*0xc\(%ebx\)
+[a-f0-9]+: 66 0f 1f 44 00 00 nopw 0x0\(%eax,%eax,1\)
[a-f0-9]+ <bar2@plt>:
- +[a-f0-9]+: f3 0f 1e fb endbr32
+ +[a-f0-9]+: f3 0f 1e fb endbr32
+[a-f0-9]+: ff a3 10 00 00 00 jmp \*0x10\(%ebx\)
+[a-f0-9]+: 66 0f 1f 44 00 00 nopw 0x0\(%eax,%eax,1\)
@@ -43,9 +43,9 @@ Disassembly of section .text:
+[a-f0-9]+: e8 c7 ff ff ff call [a-f0-9]+ <bar1@plt>
+[a-f0-9]+: 83 c4 08 add \$0x8,%esp
+[a-f0-9]+: 5b pop %ebx
- +[a-f0-9]+: c3 ret
+ +[a-f0-9]+: c3 ret
[a-f0-9]+ <__x86.get_pc_thunk.bx>:
+[a-f0-9]+: 8b 1c 24 mov \(%esp\),%ebx
- +[a-f0-9]+: c3 ret
+ +[a-f0-9]+: c3 ret
#pass
diff --git a/ld/testsuite/ld-i386/ibt-plt-2a.d b/ld/testsuite/ld-i386/ibt-plt-2a.d
index 98b6fb9..8159857 100644
--- a/ld/testsuite/ld-i386/ibt-plt-2a.d
+++ b/ld/testsuite/ld-i386/ibt-plt-2a.d
@@ -12,11 +12,11 @@ Disassembly of section .plt:
+[a-f0-9]+: ff b3 04 00 00 00 push 0x4\(%ebx\)
+[a-f0-9]+: ff a3 08 00 00 00 jmp \*0x8\(%ebx\)
+[a-f0-9]+: 0f 1f 40 00 nopl 0x0\(%eax\)
- +[a-f0-9]+: f3 0f 1e fb endbr32
+ +[a-f0-9]+: f3 0f 1e fb endbr32
+[a-f0-9]+: 68 00 00 00 00 push \$0x0
+[a-f0-9]+: e9 e2 ff ff ff jmp 140 <bar1@plt-0x30>
+[a-f0-9]+: 66 90 xchg %ax,%ax
- +[a-f0-9]+: f3 0f 1e fb endbr32
+ +[a-f0-9]+: f3 0f 1e fb endbr32
+[a-f0-9]+: 68 08 00 00 00 push \$0x8
+[a-f0-9]+: e9 d2 ff ff ff jmp 140 <bar1@plt-0x30>
+[a-f0-9]+: 66 90 xchg %ax,%ax
@@ -24,12 +24,12 @@ Disassembly of section .plt:
Disassembly of section .plt.sec:
0+170 <bar1@plt>:
- +[a-f0-9]+: f3 0f 1e fb endbr32
+ +[a-f0-9]+: f3 0f 1e fb endbr32
+[a-f0-9]+: ff a3 0c 00 00 00 jmp \*0xc\(%ebx\)
+[a-f0-9]+: 66 0f 1f 44 00 00 nopw 0x0\(%eax,%eax,1\)
0+180 <bar2@plt>:
- +[a-f0-9]+: f3 0f 1e fb endbr32
+ +[a-f0-9]+: f3 0f 1e fb endbr32
+[a-f0-9]+: ff a3 10 00 00 00 jmp \*0x10\(%ebx\)
+[a-f0-9]+: 66 0f 1f 44 00 00 nopw 0x0\(%eax,%eax,1\)
@@ -44,9 +44,9 @@ Disassembly of section .text:
+[a-f0-9]+: e8 c7 ff ff ff call 170 <bar1@plt>
+[a-f0-9]+: 83 c4 08 add \$0x8,%esp
+[a-f0-9]+: 5b pop %ebx
- +[a-f0-9]+: c3 ret
+ +[a-f0-9]+: c3 ret
0+1ae <__x86.get_pc_thunk.bx>:
+[a-f0-9]+: 8b 1c 24 mov \(%esp\),%ebx
- +[a-f0-9]+: c3 ret
+ +[a-f0-9]+: c3 ret
#pass
diff --git a/ld/testsuite/ld-i386/ibt-plt-2c.d b/ld/testsuite/ld-i386/ibt-plt-2c.d
index 445e08f..ed81809 100644
--- a/ld/testsuite/ld-i386/ibt-plt-2c.d
+++ b/ld/testsuite/ld-i386/ibt-plt-2c.d
@@ -12,11 +12,11 @@ Disassembly of section .plt:
+[a-f0-9]+: ff b3 04 00 00 00 push 0x4\(%ebx\)
+[a-f0-9]+: ff a3 08 00 00 00 jmp \*0x8\(%ebx\)
+[a-f0-9]+: 0f 1f 40 00 nopl 0x0\(%eax\)
- +[a-f0-9]+: f3 0f 1e fb endbr32
+ +[a-f0-9]+: f3 0f 1e fb endbr32
+[a-f0-9]+: 68 00 00 00 00 push \$0x0
+[a-f0-9]+: e9 e2 ff ff ff jmp [a-f0-9]+ <bar1@plt-0x30>
+[a-f0-9]+: 66 90 xchg %ax,%ax
- +[a-f0-9]+: f3 0f 1e fb endbr32
+ +[a-f0-9]+: f3 0f 1e fb endbr32
+[a-f0-9]+: 68 08 00 00 00 push \$0x8
+[a-f0-9]+: e9 d2 ff ff ff jmp [a-f0-9]+ <bar1@plt-0x30>
+[a-f0-9]+: 66 90 xchg %ax,%ax
@@ -24,12 +24,12 @@ Disassembly of section .plt:
Disassembly of section .plt.sec:
[a-f0-9]+ <bar1@plt>:
- +[a-f0-9]+: f3 0f 1e fb endbr32
+ +[a-f0-9]+: f3 0f 1e fb endbr32
+[a-f0-9]+: ff a3 0c 00 00 00 jmp \*0xc\(%ebx\)
+[a-f0-9]+: 66 0f 1f 44 00 00 nopw 0x0\(%eax,%eax,1\)
[a-f0-9]+ <bar2@plt>:
- +[a-f0-9]+: f3 0f 1e fb endbr32
+ +[a-f0-9]+: f3 0f 1e fb endbr32
+[a-f0-9]+: ff a3 10 00 00 00 jmp \*0x10\(%ebx\)
+[a-f0-9]+: 66 0f 1f 44 00 00 nopw 0x0\(%eax,%eax,1\)
@@ -44,9 +44,9 @@ Disassembly of section .text:
+[a-f0-9]+: e8 c7 ff ff ff call [a-f0-9]+ <bar1@plt>
+[a-f0-9]+: 83 c4 08 add \$0x8,%esp
+[a-f0-9]+: 5b pop %ebx
- +[a-f0-9]+: c3 ret
+ +[a-f0-9]+: c3 ret
[a-f0-9]+ <__x86.get_pc_thunk.bx>:
+[a-f0-9]+: 8b 1c 24 mov \(%esp\),%ebx
- +[a-f0-9]+: c3 ret
+ +[a-f0-9]+: c3 ret
#pass
diff --git a/ld/testsuite/ld-i386/ibt-plt-3a.d b/ld/testsuite/ld-i386/ibt-plt-3a.d
index 91f2023..9e6c8f5 100644
--- a/ld/testsuite/ld-i386/ibt-plt-3a.d
+++ b/ld/testsuite/ld-i386/ibt-plt-3a.d
@@ -12,11 +12,11 @@ Disassembly of section .plt:
+[a-f0-9]+: ff b3 04 00 00 00 push 0x4\(%ebx\)
+[a-f0-9]+: ff a3 08 00 00 00 jmp \*0x8\(%ebx\)
+[a-f0-9]+: 0f 1f 40 00 nopl 0x0\(%eax\)
- +[a-f0-9]+: f3 0f 1e fb endbr32
+ +[a-f0-9]+: f3 0f 1e fb endbr32
+[a-f0-9]+: 68 00 00 00 00 push \$0x0
+[a-f0-9]+: e9 e2 ff ff ff jmp 140 <bar1@plt-0x30>
+[a-f0-9]+: 66 90 xchg %ax,%ax
- +[a-f0-9]+: f3 0f 1e fb endbr32
+ +[a-f0-9]+: f3 0f 1e fb endbr32
+[a-f0-9]+: 68 08 00 00 00 push \$0x8
+[a-f0-9]+: e9 d2 ff ff ff jmp 140 <bar1@plt-0x30>
+[a-f0-9]+: 66 90 xchg %ax,%ax
@@ -24,12 +24,12 @@ Disassembly of section .plt:
Disassembly of section .plt.sec:
0+170 <bar1@plt>:
- +[a-f0-9]+: f3 0f 1e fb endbr32
+ +[a-f0-9]+: f3 0f 1e fb endbr32
+[a-f0-9]+: ff a3 0c 00 00 00 jmp \*0xc\(%ebx\)
+[a-f0-9]+: 66 0f 1f 44 00 00 nopw 0x0\(%eax,%eax,1\)
0+180 <bar2@plt>:
- +[a-f0-9]+: f3 0f 1e fb endbr32
+ +[a-f0-9]+: f3 0f 1e fb endbr32
+[a-f0-9]+: ff a3 10 00 00 00 jmp \*0x10\(%ebx\)
+[a-f0-9]+: 66 0f 1f 44 00 00 nopw 0x0\(%eax,%eax,1\)
@@ -44,9 +44,9 @@ Disassembly of section .text:
+[a-f0-9]+: e8 c7 ff ff ff call 170 <bar1@plt>
+[a-f0-9]+: 83 c4 08 add \$0x8,%esp
+[a-f0-9]+: 5b pop %ebx
- +[a-f0-9]+: c3 ret
+ +[a-f0-9]+: c3 ret
0+1ae <__x86.get_pc_thunk.bx>:
+[a-f0-9]+: 8b 1c 24 mov \(%esp\),%ebx
- +[a-f0-9]+: c3 ret
+ +[a-f0-9]+: c3 ret
#pass
diff --git a/ld/testsuite/ld-i386/ibt-plt-3c.d b/ld/testsuite/ld-i386/ibt-plt-3c.d
index 91f2023..9e6c8f5 100644
--- a/ld/testsuite/ld-i386/ibt-plt-3c.d
+++ b/ld/testsuite/ld-i386/ibt-plt-3c.d
@@ -12,11 +12,11 @@ Disassembly of section .plt:
+[a-f0-9]+: ff b3 04 00 00 00 push 0x4\(%ebx\)
+[a-f0-9]+: ff a3 08 00 00 00 jmp \*0x8\(%ebx\)
+[a-f0-9]+: 0f 1f 40 00 nopl 0x0\(%eax\)
- +[a-f0-9]+: f3 0f 1e fb endbr32
+ +[a-f0-9]+: f3 0f 1e fb endbr32
+[a-f0-9]+: 68 00 00 00 00 push \$0x0
+[a-f0-9]+: e9 e2 ff ff ff jmp 140 <bar1@plt-0x30>
+[a-f0-9]+: 66 90 xchg %ax,%ax
- +[a-f0-9]+: f3 0f 1e fb endbr32
+ +[a-f0-9]+: f3 0f 1e fb endbr32
+[a-f0-9]+: 68 08 00 00 00 push \$0x8
+[a-f0-9]+: e9 d2 ff ff ff jmp 140 <bar1@plt-0x30>
+[a-f0-9]+: 66 90 xchg %ax,%ax
@@ -24,12 +24,12 @@ Disassembly of section .plt:
Disassembly of section .plt.sec:
0+170 <bar1@plt>:
- +[a-f0-9]+: f3 0f 1e fb endbr32
+ +[a-f0-9]+: f3 0f 1e fb endbr32
+[a-f0-9]+: ff a3 0c 00 00 00 jmp \*0xc\(%ebx\)
+[a-f0-9]+: 66 0f 1f 44 00 00 nopw 0x0\(%eax,%eax,1\)
0+180 <bar2@plt>:
- +[a-f0-9]+: f3 0f 1e fb endbr32
+ +[a-f0-9]+: f3 0f 1e fb endbr32
+[a-f0-9]+: ff a3 10 00 00 00 jmp \*0x10\(%ebx\)
+[a-f0-9]+: 66 0f 1f 44 00 00 nopw 0x0\(%eax,%eax,1\)
@@ -44,9 +44,9 @@ Disassembly of section .text:
+[a-f0-9]+: e8 c7 ff ff ff call 170 <bar1@plt>
+[a-f0-9]+: 83 c4 08 add \$0x8,%esp
+[a-f0-9]+: 5b pop %ebx
- +[a-f0-9]+: c3 ret
+ +[a-f0-9]+: c3 ret
0+1ae <__x86.get_pc_thunk.bx>:
+[a-f0-9]+: 8b 1c 24 mov \(%esp\),%ebx
- +[a-f0-9]+: c3 ret
+ +[a-f0-9]+: c3 ret
#pass
diff --git a/ld/testsuite/ld-i386/pr20244-2a.d b/ld/testsuite/ld-i386/pr20244-2a.d
index 334b89e..fd4d076 100644
--- a/ld/testsuite/ld-i386/pr20244-2a.d
+++ b/ld/testsuite/ld-i386/pr20244-2a.d
@@ -17,10 +17,10 @@ SYMBOL TABLE:
Disassembly of section .text:
0+8048084 <foo>:
- +[a-f0-9]+: c3 ret
+ +[a-f0-9]+: c3 ret
0+8048085 <bar>:
- +[a-f0-9]+: c3 ret
+ +[a-f0-9]+: c3 ret
0+8048086 <_start>:
+[a-f0-9]+: ff 15 a8 90 04 08 call \*0x80490a8
diff --git a/ld/testsuite/ld-i386/pr20244-4a.d b/ld/testsuite/ld-i386/pr20244-4a.d
index 865d339..124af83 100644
--- a/ld/testsuite/ld-i386/pr20244-4a.d
+++ b/ld/testsuite/ld-i386/pr20244-4a.d
@@ -9,9 +9,9 @@ Disassembly of section .text:
0+804807c <_start>:
+[a-f0-9]+: 8b 05 8c 90 04 08 mov 0x804908c,%eax
- +[a-f0-9]+: c3 ret
+ +[a-f0-9]+: c3 ret
0+8048083 <ifunc>:
+[a-f0-9]+: b8 ef be ad 0b mov \$0xbadbeef,%eax
- +[a-f0-9]+: c3 ret
+ +[a-f0-9]+: c3 ret
#pass
diff --git a/ld/testsuite/ld-i386/pr23930.d b/ld/testsuite/ld-i386/pr23930.d
index e9da510..ba5cbf4 100644
--- a/ld/testsuite/ld-i386/pr23930.d
+++ b/ld/testsuite/ld-i386/pr23930.d
@@ -7,5 +7,5 @@
#...
[a-f0-9]+ <main>:
[a-f0-9]+: 31 c0 xor %eax,%eax
-[a-f0-9]+: c3 ret
+[a-f0-9]+: c3 ret
#pass
diff --git a/ld/testsuite/ld-i386/pr26018.d b/ld/testsuite/ld-i386/pr26018.d
index 9ff16c1..3bb6300 100644
--- a/ld/testsuite/ld-i386/pr26018.d
+++ b/ld/testsuite/ld-i386/pr26018.d
@@ -12,5 +12,5 @@ Disassembly of section .text:
+[a-f0-9]+: e8 00 00 00 00 call [0-9a-f]+ <foo>
[0-9a-f]+ <foo>:
- +[a-f0-9]+: c3 ret
+ +[a-f0-9]+: c3 ret
#pass
diff --git a/ld/testsuite/ld-i386/pr26263.d b/ld/testsuite/ld-i386/pr26263.d
index e6874e2..87bddd3 100644
--- a/ld/testsuite/ld-i386/pr26263.d
+++ b/ld/testsuite/ld-i386/pr26263.d
@@ -9,7 +9,7 @@
Disassembly of section .text:
0+[a-f0-9]+ <printk>:
- +[a-f0-9]+: c3 ret
+ +[a-f0-9]+: c3 ret
Disassembly of section .init.text:
diff --git a/ld/testsuite/ld-i386/pr27193.dd b/ld/testsuite/ld-i386/pr27193.dd
index 7d1e799..90b207f 100644
--- a/ld/testsuite/ld-i386/pr27193.dd
+++ b/ld/testsuite/ld-i386/pr27193.dd
@@ -1,5 +1,5 @@
#...
0+[a-f0-9]+ <__x86.get_pc_thunk.bx>:
+[a-f0-9]+: 8b 1c 24 mov \(%esp\),%ebx
- +[a-f0-9]+: c3 ret
+ +[a-f0-9]+: c3 ret
#pass
diff --git a/ld/testsuite/ld-i386/protected2.d b/ld/testsuite/ld-i386/protected2.d
index ba53e59..e1e3f94 100644
--- a/ld/testsuite/ld-i386/protected2.d
+++ b/ld/testsuite/ld-i386/protected2.d
@@ -8,9 +8,9 @@
Disassembly of section .text:
0+[a-f0-9]+ <foo>:
-[ ]*[a-f0-9]+: c3 ret
+[ ]*[a-f0-9]+: c3 ret
0+[a-f0-9]+ <bar>:
[ ]*[a-f0-9]+: e8 fa ff ff ff call [a-f0-9]+ <foo>
-[ ]*[a-f0-9]+: c3 ret
+[ ]*[a-f0-9]+: c3 ret
#pass
diff --git a/ld/testsuite/ld-i386/protected3.d b/ld/testsuite/ld-i386/protected3.d
index 47ab4e1..c3a6888 100644
--- a/ld/testsuite/ld-i386/protected3.d
+++ b/ld/testsuite/ld-i386/protected3.d
@@ -10,5 +10,5 @@ Disassembly of section .text:
0+[a-f0-9]+ <bar>:
[ ]*[a-f0-9]+: 8b 81 [a-f0-9][a-f0-9] [a-f0-9][a-f0-9] ff ff mov -0x[a-f0-9]+\(%ecx\),%eax
[ ]*[a-f0-9]+: 8b 00 mov \(%eax\),%eax
-[ ]*[a-f0-9]+: c3 ret
+[ ]*[a-f0-9]+: c3 ret
#pass
diff --git a/ld/testsuite/ld-i386/protected7.d b/ld/testsuite/ld-i386/protected7.d
index aafa2d8..6ae6007 100644
--- a/ld/testsuite/ld-i386/protected7.d
+++ b/ld/testsuite/ld-i386/protected7.d
@@ -9,5 +9,5 @@ Disassembly of section .text:
0+[a-f0-9]+ <bar>:
[ ]*[a-f0-9]+: 8b 81 [a-f0-9][a-f0-9] [a-f0-9][a-f0-9] 00 00 mov 0x[a-f0-9]+\(%ecx\),%eax
-[ ]*[a-f0-9]+: c3 ret
+[ ]*[a-f0-9]+: c3 ret
#pass
diff --git a/ld/testsuite/ld-i386/tlspie3b.d b/ld/testsuite/ld-i386/tlspie3b.d
index 7de0472..e41fcaa 100644
--- a/ld/testsuite/ld-i386/tlspie3b.d
+++ b/ld/testsuite/ld-i386/tlspie3b.d
@@ -9,7 +9,7 @@
Disassembly of section .text:
[0-9a-f]+ <___tls_get_addr>:
-[ ]*[a-f0-9]+: c3 ret
+[ ]*[a-f0-9]+: c3 ret
[0-9a-f]+ <_start>:
[ ]*[a-f0-9]+: 55 push %ebp
@@ -32,6 +32,6 @@ Disassembly of section .text:
[ ]*[a-f0-9]+: 89 f0 mov %esi,%eax
[ ]*[a-f0-9]+: 5b pop %ebx
[ ]*[a-f0-9]+: 5e pop %esi
-[ ]*[a-f0-9]+: c9 leave
-[ ]*[a-f0-9]+: c3 ret
+[ ]*[a-f0-9]+: c9 leave
+[ ]*[a-f0-9]+: c3 ret
#pass
diff --git a/ld/testsuite/ld-i386/tlspie3c.d b/ld/testsuite/ld-i386/tlspie3c.d
index aa02f57..d1639c1 100644
--- a/ld/testsuite/ld-i386/tlspie3c.d
+++ b/ld/testsuite/ld-i386/tlspie3c.d
@@ -9,7 +9,7 @@
Disassembly of section .text:
[0-9a-f]+ <___tls_get_addr>:
-[ ]*[a-f0-9]+: c3 ret
+[ ]*[a-f0-9]+: c3 ret
[0-9a-f]+ <_start>:
[ ]*[a-f0-9]+: 55 push %ebp
@@ -32,6 +32,6 @@ Disassembly of section .text:
[ ]*[a-f0-9]+: 89 f0 mov %esi,%eax
[ ]*[a-f0-9]+: 5b pop %ebx
[ ]*[a-f0-9]+: 5e pop %esi
-[ ]*[a-f0-9]+: c9 leave
-[ ]*[a-f0-9]+: c3 ret
+[ ]*[a-f0-9]+: c9 leave
+[ ]*[a-f0-9]+: c3 ret
#pass