[lld] r194860 - [PECOFF] Use INT3 instead of NOP.

Rui Ueyama ruiu at google.com
Fri Nov 15 14:11:43 PST 2013


Author: ruiu
Date: Fri Nov 15 16:11:43 2013
New Revision: 194860

URL: http://llvm.org/viewvc/llvm-project?rev=194860&view=rev
Log:
[PECOFF] Use INT3 instead of NOP.

This patch does not change the meaning of the program, but if something's wrong
in the linker or the compiler and the control reaches to the gap of imported
function table, it will stop immediately because of the presence of INT3. If
NOP, it'd fall through to the next call instruction, which is usually a
completely foreign function call.

Modified:
    lld/trunk/lib/ReaderWriter/PECOFF/ReaderImportHeader.cpp

Modified: lld/trunk/lib/ReaderWriter/PECOFF/ReaderImportHeader.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/ReaderImportHeader.cpp?rev=194860&r1=194859&r2=194860&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/ReaderImportHeader.cpp (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/ReaderImportHeader.cpp Fri Nov 15 16:11:43 2013
@@ -152,7 +152,7 @@ namespace {
 
 uint8_t FuncAtomContent[] = {
   0xff, 0x25, 0x00, 0x00, 0x00, 0x00,  // jmp *0x0
-  0x90, 0x90                           // nop; nop
+  0xcc, 0xcc                           // int 3; int 3
 };
 
 /// The defined atom for jump table.





More information about the llvm-commits mailing list