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

relocation R_X86_64_PC32 against symbol `syscall_hook' can not be used when making a shared object; recompile with -fPIC #11

Closed
98hq opened this issue Nov 10, 2023 · 2 comments

Comments

@98hq
Copy link

98hq commented Nov 10, 2023

When I type make, the error is as follows:

gcc -O3 -pipe -Werror -Wall -Wunused-function -Wextra -shared -fPIC   -c -o main.o main.c
gcc -O3 -pipe -Werror -Wall -Wunused-function -Wextra -shared -fPIC -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:30: recipe for target 'libzpoline.so' failed
make: *** [libzpoline.so] Error 1

The version of gcc I use is gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04), May I know your operating system and software configuration?

@98hq
Copy link
Author

98hq commented Nov 10, 2023

@98hq 98hq closed this as completed Nov 10, 2023
@yasukata
Copy link
Owner

Thank you very much for reporting the issue and providing the solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants