-
Notifications
You must be signed in to change notification settings - Fork 350
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
Linker error on ArchLinux #2
Comments
Same on Alpine 3.5.
|
I haven't looked into the changes required for newer GCC versions, but the workaround for this is to compile with GCC 4.x. You should be able to use some equivalent of running |
I come across similar issue when building other software in |
Thanks @NanXiao , that does indeed solve the issue. Do you know if this would have any adverse effects for older versions of GCC, or could it be added to master? |
There is no gcc version that old available on Alpine - even on ancient debian/devuan oldstable the oldest Version is 4.8 However, adding the Does this option break linking with earlier gcc versions? If not i'd suggest adding it to master. |
If libcapstone.a is not build with `-fPIC`, building `injector` fails with the error below. ``` /usr/bin/ld: injector.o: relocation R_X86_64_32S against undefined symbol `dummy_stack' can not be used when making a shared object; recompile with -fPIC ``` So explicitly link the binary as a position dependent executable by passing `-no-pie` [1]. This probably needs to be made configurable, or the build system needs to detect how `libcapstone.a` is built. [1] https://wiki.ubuntu.com/SecurityTeam/PIE Fixes: xoreaxeaxeax#2, xoreaxeaxeax#5
@LeoAdamek @rostwald I am not the gcc expert, but from my humble opinion, I don't think it can bring some negative effects. According to manual:
This option just take effect in link stage, and cause executable position independent. Personally, I think there is no other side-effect. |
|
I simply compiled the injector as static which solved the problem of
however - |
I'm getting a linker error when running
make
(Additionally I've tried adding-fPIC
to the compilation options however this hasn't solved the issue.)See below command output and versions.
From commit dff6324
make
output:cc --version
: cc (GCC) 7.1.1 20170630ld --version
: GNU ld (GNU Binutils) 2.28.0.20170506The text was updated successfully, but these errors were encountered: