I am trying to build a shared library lib_test.so
from 'test.c' & test.exp
files. This lib_test.so
file will be used as a extension to another application.
The application doc specifies generation of tle lib_test.so
file directly in a single pass by the following command:
`gcc -q64 -o lib_test.so test.c -bM:Sre -bE:test.exp -bnoentry`
But my requirement is to build the library in two passes:
- Compile to generate
test.o
file usinggcc
command. - Link to generate the library
lib_test.so
usingld
command.
I tried this as follows:
- Executed compile step as follows:
gcc -q64 -c -o test.o test.c
. - Create
lib_test.so
as follows:ld -bM:Sre -bE:test.exp -bnoentry -o lib_test.so test.o
But it is not generating a proper lib_test.so
file.
I am using Ubuntu 16.04 LTS 64-Bit with latest GCC
Can you please suggest the correct way to split the process into two passes...
Thanks & Regards.