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

Does not compile #74

Open
MayorUshanka opened this issue Oct 13, 2020 · 3 comments
Open

Does not compile #74

MayorUshanka opened this issue Oct 13, 2020 · 3 comments

Comments

@MayorUshanka
Copy link

/usr/bin/ld: injector.o: relocation R_X86_64_32S against symbol dummy_stack' can not be used when making a PIE object; recompile with -fPIE`

I edited the makefile to contain -fPIE but the error persists.

I am on manjaro linux.

@Tilka
Copy link

Tilka commented Oct 23, 2020

The opposite works: make CFLAGS=-no-pie

@doug65536
Copy link

Doesn't work for me:

doug@doug-dt:~/code/cpufuzz/sandsifter$ make CFLAGS=-fno-pie
cc -fno-pie -c injector.c -o injector.o -Wall
injector.c:321:93: warning: excess elements in array initializer
 00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, .len=0},
                                                                     ^~~~
injector.c:321:93: note: (near initialization for ‘total_range.start.bytes’)
injector.c:322:91: warning: excess elements in array initializer
 ff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff}, .len=0},
                                                                     ^~~~
injector.c:322:91: note: (near initialization for ‘total_range.end.bytes’)
cc -fno-pie injector.o -O3 -Wall -l:libcapstone.a -o injector -pthread
/usr/bin/x86_64-linux-gnu-ld: injector.o: relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/x86_64-linux-gnu-ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
Makefile:35: recipe for target 'injector' failed
make: *** [injector] Error 1
doug@doug-dt:~/code/cpufuzz/sandsifter$ 

@doug65536
Copy link

doug65536 commented Aug 25, 2024

doug@doug-dt2:~/code/sandsifter/sandsifter$ make CFLAGS="-DFORCE_SIGSTKSZ=8192 -fno-pie -Wl,-no-pie"
cc -DFORCE_SIGSTKSZ=8192 -fno-pie -Wl,-no-pie injector.o -O3 -Wall -l:libcapstone.a -o injector -pthread
doug@doug-dt2:~/code/sandsifter/sandsifter$ 

works. (needs -Wl,-no-pie too)
I only needed three years.
(JK, ubuntu just got worse and messes with link even more now, specs file is even more of a trainwreck)

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

3 participants