yasukata / zpoline

system call hook for Linux
Apache License 2.0
408 stars 32 forks source link

dereferencing pointer to incomplete type ‘struct clone_args’ #15

Open TsengMingYi opened 5 months ago

TsengMingYi commented 5 months ago

For libzpoline.so, i type the following command. make I get the following error: main.c:242:9: error: dereferencing pointer to incomplete type ‘struct clone_args’ if (ca->flags & CLONE_VM)

yasukata commented 5 months ago

Thank you for your message.

I have updated the program in https://github.com/yasukata/zpoline/commit/773a09f0064a109ef2f930a9eddd08fb2f0f7635 ; I hope this change fixes the reported issue.

I would appreciate it if you give us another message here if you still see the same error after applying the change above.

Thank you very much for reporting the issue.

TsengMingYi commented 5 months ago

Thank you for your reply.

But for libzpoline.so I type the following: make

and I get another error: **gcc -O3 -pipe -g -rdynamic -Werror -Wall -Wunused-function -Wextra -shared -fPIC -DSUPPLEMENTALREWRITTEN_ADDR_CHECK -c -o main.o main .c gcc -O3 -pipe -g -rdynamic -Werror -Wall -Wunused-function -Wextra -shared -fPIC -DSUPPLEMENTALREWRITTEN_ADDR_CHECK -o libzpoline.so main.o -lopcodes -ldl /usr/bin/ld: main.o: relocation R_X86_64_PC32 against symbol `syscall_hook' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: final link failed: Bad value collect2: error: ld returned 1 exit status Makefile:33: recipe for target 'libzpoline.so' failed make: * [libzpoline.so] Error 1

Does the error mean suggests that there is a relocation issue with this symbol ?

yasukata commented 5 months ago

Thank you for your quick reply.

Actually, I already have the pointer to the solution https://github.com/yasukata/zpoline/issues/11 , but I have not reflected it yet.

I made a change in https://github.com/yasukata/zpoline/commit/aa18e55fea1caaa2ab3f0505467218947d21ba0a to resolve this issue, and I hope that now you can compile the program.

Again, I would appreciate it if you write another message here if you still see the compilation error.

Thank you very much for your report.