From 1caf2c519abe91ba39180d491e176c38c77ba61c Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 21 Jul 2009 05:22:54 +0000 Subject: [PATCH] PR 10419 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences. --- gold/ChangeLog | 5 +++++ gold/x86_64.cc | 52 ++++++++++++++++++++++++++-------------------------- 2 files changed, 31 insertions(+), 26 deletions(-) diff --git a/gold/ChangeLog b/gold/ChangeLog index 8262c60..26e5bff 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,8 @@ +2009-07-20 Ian Lance Taylor + + PR 10419 + * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences. + 2009-07-16 Ian Lance Taylor PR 10400 diff --git a/gold/x86_64.cc b/gold/x86_64.cc index 91b542e..22d5cc6 100644 --- a/gold/x86_64.cc +++ b/gold/x86_64.cc @@ -2620,40 +2620,40 @@ Target_x86_64::do_code_fill(section_size_type length) const // Nop sequences of various lengths. const char nop1[1] = { 0x90 }; // nop const char nop2[2] = { 0x66, 0x90 }; // xchg %ax %ax - const char nop3[3] = { 0x8d, 0x76, 0x00 }; // leal 0(%esi),%esi - const char nop4[4] = { 0x8d, 0x74, 0x26, 0x00}; // leal 0(%esi,1),%esi - const char nop5[5] = { 0x90, 0x8d, 0x74, 0x26, // nop - 0x00 }; // leal 0(%esi,1),%esi - const char nop6[6] = { 0x8d, 0xb6, 0x00, 0x00, // leal 0L(%esi),%esi + const char nop3[3] = { 0x0f, 0x1f, 0x00 }; // nop (%rax) + const char nop4[4] = { 0x0f, 0x1f, 0x40, 0x00}; // nop 0(%rax) + const char nop5[5] = { 0x0f, 0x1f, 0x44, 0x00, // nop 0(%rax,%rax,1) + 0x00 }; + const char nop6[6] = { 0x66, 0x0f, 0x1f, 0x44, // nopw 0(%rax,%rax,1) 0x00, 0x00 }; - const char nop7[7] = { 0x8d, 0xb4, 0x26, 0x00, // leal 0L(%esi,1),%esi + const char nop7[7] = { 0x0f, 0x1f, 0x80, 0x00, // nopl 0L(%rax) 0x00, 0x00, 0x00 }; - const char nop8[8] = { 0x90, 0x8d, 0xb4, 0x26, // nop - 0x00, 0x00, 0x00, 0x00 }; // leal 0L(%esi,1),%esi - const char nop9[9] = { 0x89, 0xf6, 0x8d, 0xbc, // movl %esi,%esi - 0x27, 0x00, 0x00, 0x00, // leal 0L(%edi,1),%edi + const char nop8[8] = { 0x0f, 0x1f, 0x84, 0x00, // nopl 0L(%rax,%rax,1) + 0x00, 0x00, 0x00, 0x00 }; + const char nop9[9] = { 0x66, 0x0f, 0x1f, 0x84, // nopw 0L(%rax,%rax,1) + 0x00, 0x00, 0x00, 0x00, 0x00 }; - const char nop10[10] = { 0x8d, 0x76, 0x00, 0x8d, // leal 0(%esi),%esi - 0xbc, 0x27, 0x00, 0x00, // leal 0L(%edi,1),%edi + const char nop10[10] = { 0x66, 0x2e, 0x0f, 0x1f, // nopw %cs:0L(%rax,%rax,1) + 0x84, 0x00, 0x00, 0x00, 0x00, 0x00 }; - const char nop11[11] = { 0x8d, 0x74, 0x26, 0x00, // leal 0(%esi,1),%esi - 0x8d, 0xbc, 0x27, 0x00, // leal 0L(%edi,1),%edi + const char nop11[11] = { 0x66, 0x66, 0x2e, 0x0f, // data16 + 0x1f, 0x84, 0x00, 0x00, // nopw %cs:0L(%rax,%rax,1) 0x00, 0x00, 0x00 }; - const char nop12[12] = { 0x8d, 0xb6, 0x00, 0x00, // leal 0L(%esi),%esi - 0x00, 0x00, 0x8d, 0xbf, // leal 0L(%edi),%edi + const char nop12[12] = { 0x66, 0x66, 0x66, 0x2e, // data16; data16 + 0x0f, 0x1f, 0x84, 0x00, // nopw %cs:0L(%rax,%rax,1) 0x00, 0x00, 0x00, 0x00 }; - const char nop13[13] = { 0x8d, 0xb6, 0x00, 0x00, // leal 0L(%esi),%esi - 0x00, 0x00, 0x8d, 0xbc, // leal 0L(%edi,1),%edi - 0x27, 0x00, 0x00, 0x00, + const char nop13[13] = { 0x66, 0x66, 0x66, 0x66, // data16; data16; data16 + 0x2e, 0x0f, 0x1f, 0x84, // nopw %cs:0L(%rax,%rax,1) + 0x00, 0x00, 0x00, 0x00, 0x00 }; - const char nop14[14] = { 0x8d, 0xb4, 0x26, 0x00, // leal 0L(%esi,1),%esi - 0x00, 0x00, 0x00, 0x8d, // leal 0L(%edi,1),%edi - 0xbc, 0x27, 0x00, 0x00, + const char nop14[14] = { 0x66, 0x66, 0x66, 0x66, // data16; data16; data16 + 0x66, 0x2e, 0x0f, 0x1f, // data16 + 0x84, 0x00, 0x00, 0x00, // nopw %cs:0L(%rax,%rax,1) 0x00, 0x00 }; - const char nop15[15] = { 0xeb, 0x0d, 0x90, 0x90, // jmp .+15 - 0x90, 0x90, 0x90, 0x90, // nop,nop,nop,... - 0x90, 0x90, 0x90, 0x90, - 0x90, 0x90, 0x90 }; + const char nop15[15] = { 0x66, 0x66, 0x66, 0x66, // data16; data16; data16 + 0x66, 0x66, 0x2e, 0x0f, // data16; data16 + 0x1f, 0x84, 0x00, 0x00, // nopw %cs:0L(%rax,%rax,1) + 0x00, 0x00, 0x00 }; const char* nops[16] = { NULL, -- 2.7.4