*BSD News Article 69298


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.rmit.EDU.AU!news.unimelb.EDU.AU!munnari.OZ.AU!spool.mu.edu!news.sol.net!uwm.edu!newsfeed.internetmci.com!in2.uu.net!news.mathworks.com!tank.news.pipex.net!pipex!usenet1.news.uk.psi.net!uknet!dispatch.news.demon.net!demon!sunsite.doc.ic.ac.uk!yama.mcc.ac.uk!bofh.dot!zippy.dct.ac.uk!str-ccsun!not-for-mail
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: Dynamic libraries
Message-ID: <4o2arp$qo9@vulture.dmem.strath.ac.uk>
From: nbc@vulture.dmem.strath.ac.uk (Neil Brendan Clark)
Date: 23 May 1996 19:30:17 +0100
References: <slrn4pfq47.5mc.feisal@lancelot.valsayn.tt>
Organization: University of Strathclyde
NNTP-Posting-Host: vulture.dmem.strath.ac.uk
Lines: 24

Feisal Mohammed <feisal@tstt.net.tt> wrote:
>I compiled all the objects with "gcc -fPIC ..." then linked
>with "gcc -shared -o library.so ....", but I get this error message

I actually came across this problem today when "porting" some work I did
at home on NetBSD to my FreeBSD machine at work. It would appear (but I'm
not sure) that what you are doing works fine with older versions of gcc
but falls over on newer versions. Try this instead;

   ld -Bshareable -o library.so ...

instead of the gcc linking command.

BTW, do you have a good reason for using -fPIC instead of -fpic? If I recall
correctly -fPIC generates position independant code capable of longer jumps
than -fpic. The effect (if any) this has on code performance is unknown to
me but I *think* I am right in saying (at least w.r.t the 680x0 CPUs) that
longe jumps generate larger and slower code. Is this relevant to the Intel
CPUs?

-- 
            Hey dork,               | Neil Clark
      Eat this with a fork!         | Transparent Telepresence Group
                                    | <http://telepresence.dmem.strath.ac.uk/>