We have a product used for debugging applications. This creates shared
libraries from a set of 'debugging actions' specified by the user in a
largely-C based file.
Currently, we compile and link the user's actions using the Sun Workshop
C compiler but we wish to support using gcc. However, there is a problem
when building shared libraries with gcc if you specify the '-z defs'
option since the gcc startup object file (crt1.o) references main.
For instance:
gcc -z defs -G -o libgcctest.ual testgcclib.c
gives:
Undefined first referenced
symbol in file
main
/opt/gnat_311/lib/gcc-lib/sparc-sun-solaris2.5.1/2.8.1/crt1.o
Is there any way of getting around this on the command line, apart from
removing the '-z defs' option. I wondered about using the linker's
mapfile option to create a dummy symbol for main but attempts at doing
this have not been successful. An alternative solution would be to
define a weak symbol for main in assembler and link with this file. That
works but I would prefer to find a less messy, more general purpose
solution.
Any assistance is appreciated,
Andy Platt.
--
I'm not really here - it's just your warped imagination.