bfd_put_8 (abfd, opcode, contents + roff - 2);
- /* For MOVRS zap the 0f38 or EVEX prefix, applying meaningless ES
+ /* For MOVRS zap the 0f38 or EVEX prefix, applying meaningless CS
segment overrides instead. When necessary also install the REX2
prefix and payload (which may not have been written yet). */
if (movrs)
{
- bfd_put_8 (abfd, 0x26, contents + roff - movrs);
- bfd_put_8 (abfd, 0x26, contents + roff - movrs + 1);
+ bfd_put_8 (abfd, 0x2e, contents + roff - movrs);
+ bfd_put_8 (abfd, 0x2e, contents + roff - movrs + 1);
if (movrs == 6)
{
bfd_put_8 (abfd, 0xd5, contents + roff - 4);
byte. */
if (type == 0x8b)
{
- /* For MOVRS emit meaningless ES prefixes. */
+ /* For MOVRS emit meaningless CS prefixes. */
if (bfd_get_8 (input_bfd, contents + roff - 4) == 0x0f)
{
- bfd_put_8 (output_bfd, 0x26, contents + roff - 4);
- rex2 = 0x26;
+ bfd_put_8 (output_bfd, 0x2e, contents + roff - 4);
+ rex2 = 0x2e;
rex2_mask = 0;
}
type = 0xc7;
unsigned int reg = bfd_get_8 (input_bfd, contents + roff - 1);
reg >>= 3;
- /* Replace 0f38 by meaningless ES prefixes, shifting the REX
+ /* Replace 0f38 by meaningless CS prefixes, shifting the REX
prefix forward. */
- bfd_put_8 (output_bfd, 0x26, contents + roff - 5);
- bfd_put_8 (output_bfd, 0x26, contents + roff - 4);
+ bfd_put_8 (output_bfd, 0x2e, contents + roff - 5);
+ bfd_put_8 (output_bfd, 0x2e, contents + roff - 4);
bfd_put_8 (output_bfd, rex, contents + roff - 3);
bfd_put_8 (output_bfd, 0xc7, contents + roff - 2);
bfd_put_8 (output_bfd, 0xc0 | reg, contents + roff - 1);
rex2 |= REX_W;
- bfd_put_8 (output_bfd, 0x26, contents + roff - 6);
- bfd_put_8 (output_bfd, 0x26, contents + roff - 5);
+ bfd_put_8 (output_bfd, 0x2e, contents + roff - 6);
+ bfd_put_8 (output_bfd, 0x2e, contents + roff - 5);
bfd_put_8 (output_bfd, 0xd5, contents + roff - 4);
bfd_put_8 (output_bfd, rex2, contents + roff - 3);
bfd_put_8 (output_bfd, 0xc7, contents + roff - 2);
#...
[a-f0-9]+ <_start>:
-[ ]*[a-f0-9]+: 26 26 c7 c0 ([0-9a-f]{2} ){4} * (es ){2}mov \$0x[a-f0-9]+,%eax
-[ ]*[a-f0-9]+: 26 26 41 c7 c3 ([0-9a-f]{2} ){4} * (es ){2}mov \$0x[a-f0-9]+,%r11d
-[ ]*[a-f0-9]+: 26 26 d5 10 c7 c5 ([0-9a-f]{2} ){4} * (es ){2}mov \$0x[a-f0-9]+,%r21d
-[ ]*[a-f0-9]+: 26 26 48 c7 c0 ([0-9a-f]{2} ){4} * (es ){2}mov \$0x[a-f0-9]+,%rax
-[ ]*[a-f0-9]+: 26 26 49 c7 c3 ([0-9a-f]{2} ){4} * (es ){2}mov \$0x[a-f0-9]+,%r11
-[ ]*[a-f0-9]+: 26 26 d5 18 c7 c5 ([0-9a-f]{2} ){4} * (es ){2}mov \$0x[a-f0-9]+,%r21
-[ ]*[a-f0-9]+: 26 26 48 c7 c0 ([0-9a-f]{2} ){4} * (es ){2}mov \$0x[a-f0-9]+,%rax
-[ ]*[a-f0-9]+: 26 26 49 c7 c3 ([0-9a-f]{2} ){4} * (es ){2}mov \$0x[a-f0-9]+,%r11
+[ ]*[a-f0-9]+: 2e 2e c7 c0 ([0-9a-f]{2} ){4} * (cs ){2}mov \$0x[a-f0-9]+,%eax
+[ ]*[a-f0-9]+: 2e 2e 41 c7 c3 ([0-9a-f]{2} ){4} * (cs ){2}mov \$0x[a-f0-9]+,%r11d
+[ ]*[a-f0-9]+: 2e 2e d5 10 c7 c5 ([0-9a-f]{2} ){4} * (cs ){2}mov \$0x[a-f0-9]+,%r21d
+[ ]*[a-f0-9]+: 2e 2e 48 c7 c0 ([0-9a-f]{2} ){4} * (cs ){2}mov \$0x[a-f0-9]+,%rax
+[ ]*[a-f0-9]+: 2e 2e 49 c7 c3 ([0-9a-f]{2} ){4} * (cs ){2}mov \$0x[a-f0-9]+,%r11
+[ ]*[a-f0-9]+: 2e 2e d5 18 c7 c5 ([0-9a-f]{2} ){4} * (cs ){2}mov \$0x[a-f0-9]+,%r21
+[ ]*[a-f0-9]+: 2e 2e 48 c7 c0 ([0-9a-f]{2} ){4} * (cs ){2}mov \$0x[a-f0-9]+,%rax
+[ ]*[a-f0-9]+: 2e 2e 49 c7 c3 ([0-9a-f]{2} ){4} * (cs ){2}mov \$0x[a-f0-9]+,%r11
#pass
#...
[a-f0-9]+ <_start>:
-[ ]*[a-f0-9]+: 26 26 8d 05 ([0-9a-f]{2} ){4} * (es ){2}lea -0x[a-f0-9]+\(%rip\),%eax # [a-f0-9]+ <foo>
-[ ]*[a-f0-9]+: 26 26 44 8d 1d ([0-9a-f]{2} ){4} * (es ){2}lea 0x[a-f0-9]+\(%rip\),%r11d # [a-f0-9]+ <bar>
-[ ]*[a-f0-9]+: 26 26 d5 40 8d 2d ([0-9a-f]{2} ){4} * (es ){2}lea 0x[a-f0-9]+\(%rip\),%r21d # [a-f0-9]+ <bar>
-[ ]*[a-f0-9]+: 26 26 48 8d 05 ([0-9a-f]{2} ){4} * (es ){2}lea -0x[a-f0-9]+\(%rip\),%rax # [a-f0-9]+ <foo>
-[ ]*[a-f0-9]+: 26 26 4c 8d 1d ([0-9a-f]{2} ){4} * (es ){2}lea 0x[a-f0-9]+\(%rip\),%r11 # [a-f0-9]+ <bar>
-[ ]*[a-f0-9]+: 26 26 d5 48 8d 2d ([0-9a-f]{2} ){4} * (es ){2}lea 0x[a-f0-9]+\(%rip\),%r21 # [a-f0-9]+ <bar>
-[ ]*[a-f0-9]+: 26 26 48 8d 05 ([0-9a-f]{2} ){4} * (es ){2}lea 0x[a-f0-9]+\(%rip\),%rax # [a-f0-9]+ <__start_my_section>
-[ ]*[a-f0-9]+: 26 26 4c 8d 1d ([0-9a-f]{2} ){4} * (es ){2}lea 0x[a-f0-9]+\(%rip\),%r11 # [a-f0-9]+ <(__stop_my_section|pad)>
+[ ]*[a-f0-9]+: 2e 2e 8d 05 ([0-9a-f]{2} ){4} * (cs ){2}lea -0x[a-f0-9]+\(%rip\),%eax # [a-f0-9]+ <foo>
+[ ]*[a-f0-9]+: 2e 2e 44 8d 1d ([0-9a-f]{2} ){4} * (cs ){2}lea 0x[a-f0-9]+\(%rip\),%r11d # [a-f0-9]+ <bar>
+[ ]*[a-f0-9]+: 2e 2e d5 40 8d 2d ([0-9a-f]{2} ){4} * (cs ){2}lea 0x[a-f0-9]+\(%rip\),%r21d # [a-f0-9]+ <bar>
+[ ]*[a-f0-9]+: 2e 2e 48 8d 05 ([0-9a-f]{2} ){4} * (cs ){2}lea -0x[a-f0-9]+\(%rip\),%rax # [a-f0-9]+ <foo>
+[ ]*[a-f0-9]+: 2e 2e 4c 8d 1d ([0-9a-f]{2} ){4} * (cs ){2}lea 0x[a-f0-9]+\(%rip\),%r11 # [a-f0-9]+ <bar>
+[ ]*[a-f0-9]+: 2e 2e d5 48 8d 2d ([0-9a-f]{2} ){4} * (cs ){2}lea 0x[a-f0-9]+\(%rip\),%r21 # [a-f0-9]+ <bar>
+[ ]*[a-f0-9]+: 2e 2e 48 8d 05 ([0-9a-f]{2} ){4} * (cs ){2}lea 0x[a-f0-9]+\(%rip\),%rax # [a-f0-9]+ <__start_my_section>
+[ ]*[a-f0-9]+: 2e 2e 4c 8d 1d ([0-9a-f]{2} ){4} * (cs ){2}lea 0x[a-f0-9]+\(%rip\),%r11 # [a-f0-9]+ <(__stop_my_section|pad)>
#pass
+[0-9a-f]+: d5 18 c7 c5 90 ff ff[ ]+mov \$0xf+90,%r21
# sl5
+[0-9a-f]+: ff *
- +[0-9a-f]+: 26 26 49 c7 c3 90 ff[ ]+(es ){2}mov \$0xf+90,%r11
+ +[0-9a-f]+: 2e 2e 49 c7 c3 90 ff[ ]+(cs ){2}mov \$0xf+90,%r11
# sl5
+[0-9a-f]+: ff ff *
- +[0-9a-f]+: 26 26 d5 18 c7 c5 90[ ]+(es ){2}mov \$0xf+90,%r21
+ +[0-9a-f]+: 2e 2e d5 18 c7 c5 90[ ]+(cs ){2}mov \$0xf+90,%r21
# sl5
+[0-9a-f]+: ff ff ff *
# IE->LE against hidden var
+[0-9a-f]+: d5 18 c7 c6 b0 ff ff[ ]+mov \$0xf+b0,%r22
+[0-9a-f]+: ff *
- +[0-9a-f]+: 26 26 49 c7 c4 b0 ff[ ]+(es ){2}mov \$0xf+b0,%r12
+ +[0-9a-f]+: 2e 2e 49 c7 c4 b0 ff[ ]+(cs ){2}mov \$0xf+b0,%r12
+[0-9a-f]+: ff ff *
- +[0-9a-f]+: 26 26 d5 18 c7 c6 b0[ ]+(es ){2}mov \$0xf+b0,%r22
+ +[0-9a-f]+: 2e 2e d5 18 c7 c6 b0[ ]+(cs ){2}mov \$0xf+b0,%r22
+[0-9a-f]+: ff ff ff *
# GD -> IE because variable is not defined in executable
+[0-9a-f]+: d5 48 8b 05 ([0-9a-f]{2} ){3}[ ]+mov 0x[0-9a-f]+\(%rip\),%r16 +# [0-9a-f]+ <sG1>