cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: [Q] relocations remain against allocatable but non-writable sections and relocation error on Solaris/gcc

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 9 Jan 2002 20:32:15 +0100 (MET)

On Tue, 8 Jan 2002, Miklos Nemeth wrote:

> I'm using Solaris 7 (SunOS 5.7) with gcc2.95.3 and the systems ld-tool
> (Software Generation Utilities - Solaris/ELF (3.0)) I have to link libcurl
> and OpenSSL statically into my dynamic/shared library (my.so).
>
> Here is my link command:
>
> ld -G -o my.so -z text my.o libssl.a libcrypto.a curl/lib/.libs/libcurl.a
> -lsocket -lnsl
>
> and I get this:
>
> Text relocation remains referenced
> against symbol offset in file
> <unknown> 0x48 lib/sol7/libcurl.a(escape.o)
> <unknown> 0xcc lib/sol7/libcurl.a(escape.o)

I've never seen this happen before. I googled around a bit for this but the
only suggestion I found was on the top of this page:
http://realm.progsoc.uts.edu.au/~subtle/solaris28_link.html that suggests
that you should use the -mimpure-text together with the -shared option.

The GCC 3 man page says this about that option:

     -mimpure-text
         -mimpure-text, used in addition to -shared, tells the
         compiler to not pass -assert pure-text to the linker
         when linking a shared object.

> Is the libcurl.a in the lib/.libs directy made of the PIC objects?

Eh, no.

First, I'd suggest that you 'make install' libcurl first, and then I'd
suggest that you use the shared version of libcurl instead of the static
one...

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
Received on 2002-01-09