Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] cannot use retrowrite with binary compiled with gcc or g++ #34

Open
ha2san opened this issue Apr 5, 2022 · 0 comments
Open

[BUG] cannot use retrowrite with binary compiled with gcc or g++ #34

ha2san opened this issue Apr 5, 2022 · 0 comments
Labels
analysis-needed This issue needs analysis and possible research to solve. bug Something isn't working

Comments

@ha2san
Copy link

ha2san commented Apr 5, 2022

Description
retrowrite print no issue when runned on binary compiled with gcc but when I try to assemble the generated assembly with gcc I get this error:

/usr/bin/ld:hello.asm: file format not recognized; treating as linker script
/usr/bin/ld:hello.asm:1: syntax error
collect2: error: ld returned 1 exit status

Environment:

OS: 5.14.21-2-MANJARO x86_64 GNU/Linux
GCC: gcc (GCC) 11.2.0
clang:13.0.1
retrowrite at commit: 7c230bc

I tried with a simple hello world program:

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[])
{
    printf("Hello, World!\n");

    return 0;
}

And compile it with gcc: gcc -O0 -ggdb -Wall -Wpedantic -Wextra -fPIC -fPIE -pie hello.c -o hello
then ./retrowrite hello hello.asm
gcc hello.asm -o hello_instrumented => error
note that clang hello.asm -o hello_instrumented seems to work on some files

@ha2san ha2san added analysis-needed This issue needs analysis and possible research to solve. bug Something isn't working labels Apr 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analysis-needed This issue needs analysis and possible research to solve. bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant