[LLVMdev] potential mach_override/mach_override.c fix

Jack Howarth howarth at bromo.med.uc.edu
Wed Nov 14 18:18:24 PST 2012


   In testing build patches for gcc 4.8 to allow darwin to have asan support,
I ran across a defect in mach_override/mach_override.c...

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55289#c27

which was solved with the patch proposed by Alexander Potapenko in...

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55289#c29

Index: mach_override.c
===================================================================
--- mach_override.c    (revision 167724)
+++ mach_override.c    (working copy)
@@ -725,6 +725,8 @@
         { 0x2, {0xFF, 0x00}, {0x89, 0x00} },                               //
mov r/m32,r32 or r/m16,r16
         { 0x3, {0xFF, 0xFF, 0xFF}, {0x49, 0x89, 0xF8} },                   //
mov %rdi,%r8
         { 0x4, {0xFF, 0xFF, 0xFF, 0xFF}, {0x40, 0x0F, 0xBE, 0xCE} },       //
movsbl %sil,%ecx
+        { 0x7, {0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00},
+               {0x48, 0x8D, 0x05, 0x00, 0x00, 0x00, 0x00} },  // lea
$imm(%rip),%rax
         { 0x3, {0xFF, 0xFF, 0xFF}, {0x0F, 0xBE, 0xCE} },  // movsbl, %dh, %ecx
         { 0x3, {0xFF, 0xFF, 0x00}, {0xFF, 0x77, 0x00} },  // pushq $imm(%rdi)
         { 0x2, {0xFF, 0xFF}, {0xDB, 0xE3} }, // fninit

which produced a usable libsanitizer on x86_64 and i386 darwin. Perhaps these
instances of lea aren't a problem on llvm, but I thought I ought to point this
fix out as a potential change for the llvm 3.2 release.
                Jack



More information about the llvm-dev mailing list