When I compile print.s using gcc I get the following error:
/usr/bin/ld: /tmp/cc45uyZj.o: relocation R_X86_64_32S against `.data' 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
I tried the same in another linux distribution and it worked perfectly.
Adding
-fPIC
doesn't help. Nor does apt-get update.if you want to see the code: https://github.com/NEGU93/Compilation.git inside the Practice > Part1. Of course is the file print.s (btw. all the .s files have similar errors when I do gcc).
I guess something is missing in the Kali distro but I don't know what can it be.