From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21889 invoked by alias); 19 Jun 2002 01:43:35 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 21839 invoked from network); 19 Jun 2002 01:43:32 -0000 Received: from unknown (HELO hanghau.pacific.net.hk) (202.64.33.137) by sources.redhat.com with SMTP; 19 Jun 2002 01:43:32 -0000 Received: from alex (ip3.bb34.pacific.net.hk [202.64.34.3]) by hanghau.pacific.net.hk with SMTP id g5J1hP600416; Wed, 19 Jun 2002 09:43:31 +0800 (CST) Message-ID: <004201c21739$0537e880$270620c0@task.com.hk> From: "Alex Chan" To: Cc: "StanleyYu" References: Subject: SCO UNIX 5.0.5 with gcc 2.95.2 link problem Date: Tue, 18 Jun 2002 18:43:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 X-SW-Source: 2002-06/txt/msg00173.txt.bz2 Dear all, When we try to build shared libraries (.so) on SCO UNIX 5.0.5 with gcc 2.95.2, it often complains with messages similar to the following (e.g.): g++ -O -I. -I/usr/abc/isam/include -I/usr/abc/SSF/include -I/usr/abc/S SF/ddf/cpp -I/usr/abc/utility -I/usr/local/include -I/usr/local/include -I/u s r/informix/incl/esql -fPIC -shared -o procf.so procf.o -L/usr/informix/lib -L/us r/informix/lib/esql `esql -libs` -linfxxa relocations referenced from file(s) procf.o /usr/lib/libnsl_s.a(t_accept.o) /usr/lib/libnsl_s.a(t_bind.o) /usr/lib/libnsl_s.a(t_connect.o) /usr/lib/libnsl_s.a(t_close.o) /usr/lib/libnsl_s.a(t_listen.o) /usr/lib/libnsl_s.a(t_look.o) /usr/lib/libnsl_s.a(t_rcv.o) /usr/lib/libnsl_s.a(t_rcvconnect.o) /usr/lib/libnsl_s.a(t_rcvdis.o) /usr/lib/libnsl_s.a(t_snd.o) /usr/lib/libnsl_s.a(t_snddis.o) /usr/lib/libnsl_s.a(t_unbind.o) /usr/lib/libnsl_s.a(t_optmgmt.o) /usr/lib/libnsl_s.a(t_rcvudata.o) /usr/lib/libnsl_s.a(t_sndudata.o) /usr/lib/libnsl_s.a(t_sndrel.o) /usr/lib/libnsl_s.a(t_rcvrel.o) /usr/lib/libnsl_s.a(t_alloc.o) /usr/lib/libnsl_s.a(t_free.o) /usr/lib/libnsl_s.a(t_open.o) /usr/lib/libnsl_s.a(t_sync.o) /usr/lib/libnsl_s.a(_conn_util.o) /usr/lib/libnsl_s.a(_utility.o) /usr/ccs/lib/libcrypt_i.a(crypt.o) /usr/ccs/lib/libcrypt_i.a(des_crypt.o) fatal error: relocations remain against allocatable but non-writable section: . text collect2: ld returned 1 exit status Does it suggest that some symbols are unresolved or what? We have solved this once (for a particular case) involving linking against the math library -lm which comes with an archive (.a) only on SCO. We either have to instruct the linker to static link with the math library or reconstruct a libm.so from the archive contents to get it work. Surely this is not a good idea in general. Any advice? Thanks and Regards Alex