diff options
author | Cary Coutant <ccoutant@google.com> | 2011-12-17 22:39:52 +0000 |
---|---|---|
committer | Cary Coutant <ccoutant@google.com> | 2011-12-17 22:39:52 +0000 |
commit | 76677ad0511926923fd951df8d73efb783ced103 (patch) | |
tree | eacd6a0aceafd93481a3837a4f9c041f737128ea /gold/i386.cc | |
parent | dd274a34d22249bd4ae2e868fdd02678f69dd36c (diff) | |
download | gdb-76677ad0511926923fd951df8d73efb783ced103.zip gdb-76677ad0511926923fd951df8d73efb783ced103.tar.gz gdb-76677ad0511926923fd951df8d73efb783ced103.tar.bz2 |
2011-12-17 Cary Coutant <ccoutant@google.com>
* dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
* resolve.cc (Symbol_table::resolve): Likewise.
* i386.cc (Target_i386::do_code_fill): Use char constants for nop
arrays.
* x86_64.cc (Target_x86_64::do_code_fill): Likewise.
Diffstat (limited to 'gold/i386.cc')
-rw-r--r-- | gold/i386.cc | 81 |
1 files changed, 45 insertions, 36 deletions
diff --git a/gold/i386.cc b/gold/i386.cc index 191a915..efb6248 100644 --- a/gold/i386.cc +++ b/gold/i386.cc @@ -3474,42 +3474,51 @@ Target_i386::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 - 0x00, 0x00 }; - const char nop7[7] = { 0x8d, 0xb4, 0x26, 0x00, // leal 0L(%esi,1),%esi - 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 - 0x00 }; - const char nop10[10] = { 0x8d, 0x76, 0x00, 0x8d, // leal 0(%esi),%esi - 0xbc, 0x27, 0x00, 0x00, // leal 0L(%edi,1),%edi - 0x00, 0x00 }; - const char nop11[11] = { 0x8d, 0x74, 0x26, 0x00, // leal 0(%esi,1),%esi - 0x8d, 0xbc, 0x27, 0x00, // leal 0L(%edi,1),%edi - 0x00, 0x00, 0x00 }; - const char nop12[12] = { 0x8d, 0xb6, 0x00, 0x00, // leal 0L(%esi),%esi - 0x00, 0x00, 0x8d, 0xbf, // leal 0L(%edi),%edi - 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, - 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, - 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 nop1[1] = { '\x90' }; // nop + const char nop2[2] = { '\x66', '\x90' }; // xchg %ax %ax + const char nop3[3] = { '\x8d', '\x76', '\x00' }; // leal 0(%esi),%esi + const char nop4[4] = { '\x8d', '\x74', '\x26', // leal 0(%esi,1),%esi + '\x00'}; + const char nop5[5] = { '\x90', '\x8d', '\x74', // nop + '\x26', '\x00' }; // leal 0(%esi,1),%esi + const char nop6[6] = { '\x8d', '\xb6', '\x00', // leal 0L(%esi),%esi + '\x00', '\x00', '\x00' }; + const char nop7[7] = { '\x8d', '\xb4', '\x26', // leal 0L(%esi,1),%esi + '\x00', '\x00', '\x00', + '\x00' }; + const char nop8[8] = { '\x90', '\x8d', '\xb4', // nop + '\x26', '\x00', '\x00', // leal 0L(%esi,1),%esi + '\x00', '\x00' }; + const char nop9[9] = { '\x89', '\xf6', '\x8d', // movl %esi,%esi + '\xbc', '\x27', '\x00', // leal 0L(%edi,1),%edi + '\x00', '\x00', '\x00' }; + const char nop10[10] = { '\x8d', '\x76', '\x00', // leal 0(%esi),%esi + '\x8d', '\xbc', '\x27', // leal 0L(%edi,1),%edi + '\x00', '\x00', '\x00', + '\x00' }; + const char nop11[11] = { '\x8d', '\x74', '\x26', // leal 0(%esi,1),%esi + '\x00', '\x8d', '\xbc', // leal 0L(%edi,1),%edi + '\x27', '\x00', '\x00', + '\x00', '\x00' }; + const char nop12[12] = { '\x8d', '\xb6', '\x00', // leal 0L(%esi),%esi + '\x00', '\x00', '\x00', // leal 0L(%edi),%edi + '\x8d', '\xbf', '\x00', + '\x00', '\x00', '\x00' }; + const char nop13[13] = { '\x8d', '\xb6', '\x00', // leal 0L(%esi),%esi + '\x00', '\x00', '\x00', // leal 0L(%edi,1),%edi + '\x8d', '\xbc', '\x27', + '\x00', '\x00', '\x00', + '\x00' }; + const char nop14[14] = { '\x8d', '\xb4', '\x26', // leal 0L(%esi,1),%esi + '\x00', '\x00', '\x00', // leal 0L(%edi,1),%edi + '\x00', '\x8d', '\xbc', + '\x27', '\x00', '\x00', + '\x00', '\x00' }; + const char nop15[15] = { '\xeb', '\x0d', '\x90', // jmp .+15 + '\x90', '\x90', '\x90', // nop,nop,nop,... + '\x90', '\x90', '\x90', + '\x90', '\x90', '\x90', + '\x90', '\x90', '\x90' }; const char* nops[16] = { NULL, |