HexHive / retrowrite

RetroWrite -- Retrofitting compiler passes through binary rewriting
Other
655 stars 78 forks source link

Instrumenting binary compiled by GCC results in a ILLEGAL INSTRUCTION error, while same binary but compiled by clang does work. #19

Closed DBGilles closed 3 years ago

DBGilles commented 3 years ago

I compiled a sample piece of code with gcc

print.c

#include <stdio.h> 

int main(){
        int y = 10; 
        int x = 12 + y;
        printf("result is %i\n", x);    
}

When instrumenting a binary with RetroWrite that was compiled using GCC and running it I get a Illegal Instruction error. When the binary was compiled using clang it works fine.

cyanpencil commented 3 years ago

Thank you for your time. I recently pushed a fix, and it should now work on gcc versions as old as 8.4.