swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: nil_method (linking duplicate symbols)


From: Sven N. Thommesen
Subject: Re: nil_method (linking duplicate symbols)
Date: Thu, 23 Apr 1998 10:57:46 -0500

At 09:22 AM 4/23/98 -0400, you wrote:
>
>One last try at this before we are forced to 
>going to the new gcc... (we just installed 2.7.2.3  six months
>ago...its hard to get the energy to do this more than once a year!)
>
>I thought there were some way(s) to get ld to take
>the first occurence of a symbol and ignore the others,
>when it occurs in more than one of the lib files, say.
>(In fact I vaguely recall getting bit by this and getting
>the wrong version of something loaded out of multiple X libs!)
>
>For example, the ld +n option says:
>
>           +n             Causes the linker to load all object modules
>                          before searching any archive or shared libraries.
>                          Then it searches the archive and shared libraries
>                          specified on the command line in left to right
>                          order.  Repeats the left to right search of the
>                          libraries on the command line until there are no
>                          more unsatisfied symbols, or the last search added
>                          no new definitions.  This option is useful if two
>                          libraries are specified that have symbol
>                          dependencies on each other.
>
>So I put nil_method into its own file, and then make a libnil.a and
>then I passed that via gcc's -Xlinker option, with -lnil 
>to the left of the other libraries, hoping that would 
>lead it to load my nil_method first, and ignore the others.

Hypothetical possibility, reading the above very literally: nil_method is
called from one of the libraries -- then the linker keeps searching
left-to-right, finding the 'wrong' version and never looking for it in your
(left-most) .a file ...
If correct, you'd have to find out what library calls nil_method, and put
your own call to -lnil right after that !

Cheers,
Sven


                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.
                  ==================================


reply via email to

[Prev in Thread] Current Thread [Next in Thread]