allynm
June 8th, 2013, 03:59 PM
Hello everyone,
I decided to learn more about shared objects, the dynamic linker, etc. My question pertains to Postition Independent Code creation using the as (GAS) command. There is no command line option to create PIC from an assembly language file. One can use gcc -fPIC -o out.obj out.s and this will create PIC which can subsequently be linked using -shared option to produce an libout.so How would one create PIC from the as command, followed by the ld command? There must be some way to do it by including the appropriate libraries but I can't zero in on what they are.
Thanks,
Mark Allyn
I decided to learn more about shared objects, the dynamic linker, etc. My question pertains to Postition Independent Code creation using the as (GAS) command. There is no command line option to create PIC from an assembly language file. One can use gcc -fPIC -o out.obj out.s and this will create PIC which can subsequently be linked using -shared option to produce an libout.so How would one create PIC from the as command, followed by the ld command? There must be some way to do it by including the appropriate libraries but I can't zero in on what they are.
Thanks,
Mark Allyn