I'm trying to compile a C executable on Kali Linux: https://www.exploit-db.com/exploits/17787/
# gcc -o out 17787.c -lrt
/usr/bin/ld: /tmp/ccv59WCS.o: relocation R_X86_64_32S against symbol `kernel_code' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
Does anyone know why this is happening, or why it thinks I'm trying to compile a shared object? As far as I know this should just generate an ELF executable...
# gcc --version
gcc (Debian 6.3.0-6) 6.3.0 20170205
# uname -a
Linux kali 4.9.0-kali2-amd64 #1 SMP Debian 4.9.10-1kali1 (2017-02-20) x86_64 GNU/Linux
Thanks!