I am making a relocatable shared library (all compiles should be with -fPIC and -DPIC) using several object files assembled from assembly code.
In my codes I have push label
instructions. When I assemble my assembly code down to an object file using -fPIC -DPIC
everything looks fine, however when I want to make the shared library using the object files I get the relocation R_X86_64_32S against '.text' can not be used when making a shared object; recompile with -fPIC
message.
I am sure the problem is with these push label
instructions as when I remove them the error vanishes.
Any idea on how can I get it assembled?
By the way my platform is Linux with Intel x86_64 architecture and the compiler is gcc
with GAS syntax. I am interested in 64bit libraries.