Don't Recompile with -no-pie

X86-64 NASM Assembly and PIE

If you get the following runtime error when attempting to execute a 64-bit C application that links with a 64-bit NASM assembly object on Linux:
./a.out: Symbol `printf' causes overflow in R_X86_64_PC32 relocation
Segmentation fault (core dumped)
Don't do what is commonly suggested on other blogs and recompile with -no-pie. From the NASM Manual:
Calling procedures outside your shared library has to be done by means of a procedure linkage table, or PLT
All this means is that in order to be PIE-compatible under Linux, change:
 call       printf
To:
 call       printf wrt ..plt
Then recompile everything and the 64-bit NASM assembly object will be able to call printf in a position-independent way.

Comments