This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]