diff options
author | Jan Beulich <jbeulich@suse.com> | 2023-10-23 10:30:55 +0200 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2023-10-23 10:30:55 +0200 |
commit | 5e0729b655a2594c7b6750fb53f2f99750744ca2 (patch) | |
tree | 3ff4bbf242aa4d11a5d621aca5036b29affd91dd | |
parent | d164359dbc14c8ae4c7a117d236f5b7de4af671a (diff) | |
download | fsf-binutils-gdb-5e0729b655a2594c7b6750fb53f2f99750744ca2.zip fsf-binutils-gdb-5e0729b655a2594c7b6750fb53f2f99750744ca2.tar.gz fsf-binutils-gdb-5e0729b655a2594c7b6750fb53f2f99750744ca2.tar.bz2 |
x86: don't use operand size override with NOP in 16-bit code
Since we don't key the NOP selection to user-controlled properties, we
may not use i386 features; otherwise we would violate a possible .arch
directive restricting ISA to pre-386.
-rw-r--r-- | gas/config/tc-i386.c | 3 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/nop-2.d | 2 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/nops16-1.d | 16 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/x86-64-nop-2.d | 2 |
4 files changed, 12 insertions, 11 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index bec6304..b8df4e9 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -1291,6 +1291,7 @@ static const unsigned char f64_7[] = #define f64_8 (f64_9 + 1) /* lea 0L(%rsi,%riz),%rsi */ static const unsigned char f64_9[] = {0x2e,0x48,0x8d,0xb4,0x26,0x00,0x00,0x00,0x00}; /* lea %cs:0L(%rsi,%riz),%rsi */ +#define f16_2 (f64_3 + 1) /* mov %si,%si */ static const unsigned char f16_3[] = {0x8d,0x74,0x00}; /* lea 0(%si),%si */ static const unsigned char f16_4[] = @@ -1311,7 +1312,7 @@ static const unsigned char *const f64_patt[] = { }; /* 16-bit NOPs patterns. */ static const unsigned char *const f16_patt[] = { - f32_1, f32_2, f16_3, f16_4 + f32_1, f16_2, f16_3, f16_4 }; /* nopl (%[re]ax) */ static const unsigned char alt_3[] = diff --git a/gas/testsuite/gas/i386/nop-2.d b/gas/testsuite/gas/i386/nop-2.d index e8df5ed..265fc35 100644 --- a/gas/testsuite/gas/i386/nop-2.d +++ b/gas/testsuite/gas/i386/nop-2.d @@ -26,7 +26,7 @@ Disassembly of section .text: +[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si +[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si +[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si - +[a-f0-9]+: 66 90 xchg %eax,%eax + +[a-f0-9]+: 89 f6 mov %si,%si 0+26 <pseudo_30>: +[a-f0-9]+: eb 1c jmp 44 <pseudo_129> diff --git a/gas/testsuite/gas/i386/nops16-1.d b/gas/testsuite/gas/i386/nops16-1.d index 0f302c9..d5fdbca 100644 --- a/gas/testsuite/gas/i386/nops16-1.d +++ b/gas/testsuite/gas/i386/nops16-1.d @@ -55,7 +55,7 @@ Disassembly of section .text: [ ]*[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si [ ]*[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si [ ]*[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si -[ ]*[a-f0-9]+: 66 90 xchg %eax,%eax +[ ]*[a-f0-9]+: 89 f6 mov %si,%si 0+80 <nop27>: [ ]*[a-f0-9]+: 90 nop @@ -118,7 +118,7 @@ Disassembly of section .text: [ ]*[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si [ ]*[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si [ ]*[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si -[ ]*[a-f0-9]+: 66 90 xchg %eax,%eax +[ ]*[a-f0-9]+: 89 f6 mov %si,%si 0+100 <nop23>: [ ]*[a-f0-9]+: 90 nop @@ -193,7 +193,7 @@ Disassembly of section .text: [ ]*[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si [ ]*[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si [ ]*[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si -[ ]*[a-f0-9]+: 66 90 xchg %eax,%eax +[ ]*[a-f0-9]+: 89 f6 mov %si,%si 0+180 <nop19>: [ ]*[a-f0-9]+: 90 nop @@ -280,7 +280,7 @@ Disassembly of section .text: [ ]*[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si [ ]*[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si [ ]*[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si -[ ]*[a-f0-9]+: 66 90 xchg %eax,%eax +[ ]*[a-f0-9]+: 89 f6 mov %si,%si 0+200 <nop15>: [ ]*[a-f0-9]+: 90 nop @@ -315,7 +315,7 @@ Disassembly of section .text: [ ]*[a-f0-9]+: eb 0a jmp 240 <nop11> [ ]*[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si [ ]*[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si -[ ]*[a-f0-9]+: 66 90 xchg %eax,%eax +[ ]*[a-f0-9]+: 89 f6 mov %si,%si 0+240 <nop11>: [ ]*[a-f0-9]+: 90 nop @@ -336,7 +336,7 @@ Disassembly of section .text: [ ]*[a-f0-9]+: 90 nop [ ]*[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si [ ]*[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si -[ ]*[a-f0-9]+: 66 90 xchg %eax,%eax +[ ]*[a-f0-9]+: 89 f6 mov %si,%si 0+260 <nop9>: [ ]*[a-f0-9]+: 90 nop @@ -387,7 +387,7 @@ Disassembly of section .text: [ ]*[a-f0-9]+: 90 nop [ ]*[a-f0-9]+: 90 nop [ ]*[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si -[ ]*[a-f0-9]+: 66 90 xchg %eax,%eax +[ ]*[a-f0-9]+: 89 f6 mov %si,%si 0+2a0 <nop5>: [ ]*[a-f0-9]+: 90 nop @@ -450,5 +450,5 @@ Disassembly of section .text: [ ]*[a-f0-9]+: 90 nop [ ]*[a-f0-9]+: 90 nop [ ]*[a-f0-9]+: 90 nop -[ ]*[a-f0-9]+: 66 90 xchg %eax,%eax +[ ]*[a-f0-9]+: 89 f6 mov %si,%si #pass diff --git a/gas/testsuite/gas/i386/x86-64-nop-2.d b/gas/testsuite/gas/i386/x86-64-nop-2.d index 4e38b73..1594541 100644 --- a/gas/testsuite/gas/i386/x86-64-nop-2.d +++ b/gas/testsuite/gas/i386/x86-64-nop-2.d @@ -27,7 +27,7 @@ Disassembly of section .text: +[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si +[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si +[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si - +[a-f0-9]+: 66 90 xchg %eax,%eax + +[a-f0-9]+: 89 f6 mov %si,%si 0+26 <pseudo_30>: +[a-f0-9]+: eb 1c jmp 44 <pseudo_129> |