This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
using a static library in a shared library?
- From: "Lindsay, Steve" <steve dot lindsay at misys dot com>
- To: "'gcc-help at gcc dot gnu dot org'" <gcc-help at gcc dot gnu dot org>
- Date: Mon, 15 Jul 2002 11:08:10 +0100
- Subject: using a static library in a shared library?
Is it possible to build a shared library that contains a static library?
In other words, I want to create something called libmyshared.so which
uses functions in something called libcus.a.
I'm using gcc 2.95.3 on Solaris 8.
When I type:
gcc -shared -o libmyshared.so mytest.o
/export/home/CASmf/SunOS/obj/libcus.a
I get a huge long list like this:
Text relocation remains referenced
against symbol offset in file
<unknown> 0x19f0
/export/home/CASmf/SunOS/obj/libcus.a(cusapi2.o)
<unknown> 0x19f4
/export/home/CASmf/SunOS/obj/libcus.a(cusapi2.o)
<unknown> 0x19f8
/export/home/CASmf/SunOS/obj/libcus.a(cusapi2.o)
<unknown> 0x19fc
/export/home/CASmf/SunOS/obj/libcus.a(cusapi2.o)
<unknown> 0x244c
/export/home/CASmf/SunOS/obj/libcus.a(cusapiint.o)
<unknown> 0x2450
/export/home/CASmf/SunOS/obj/libcus.a(cusapiint.o)
ending with:
ld: fatal: relocations remain against allocatable but non-writable
sections
collect2: ld returned 1 exit status
I've looked through the GCC documentation and haven't found an answer to
this question. Could someone point me in the right direction, or tell
me if what I'm trying to do is possible?
Thanks,
Steve Lindsay