swarm-support
[Top][All Lists]
Advanced

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

nil_method (linking duplicate symbols)


From: Rick Riolo
Subject: nil_method (linking duplicate symbols)
Date: Thu, 23 Apr 1998 09:22:57 -0400 (EDT)

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.
(I'll admit it doesn't quite say it will do the ignoring...)
But I still get the duplicate symbols message.

Am I just hallucinating that load-first only feature,
or am I just not doing it right?
Anyone out there a gcc/ld expert?

thanks.

- r

ps I suppose this might work in the new gcc exactly 
   as I am doing above, *except* in the new gcc since nil_method
   is in a lib file by itself, that file will not get read
   at all because there are no unresolved symbols that
   require anything in that file (given that I supply nil_method
   before then).   As it is now, even though I give it nil_method,
   when it gets to libobjc.a it has to load that lib anyway,
   so it hits the duplicate nil_method.

Rick Riolo                           address@hidden
Program for Study of Complex Systems (PSCS)
4068 Randall Lab                
University of Michigan         Ann Arbor MI 48109-1120
Phone: 313 763 3323                  Fax: 313 763 9267
http://www.pscs.umich.edu/PEOPLE/rlr-home.html


                  ==================================
   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]