Symbol collisions

Symbol collisions

Post by Panka » Sat, 28 Jun 2003 05:09:11



I am having a problem on SOLARIS with symbol collision. I am building
a server that links dynamically to two shared libraries which have the
same symbol XMLReader. As a result of this symbol collision I get a
segmentation violation.  These two libraries are third party libraries
and therefore I do not have the source code to change the name. If any
one has dealt with these kind of situations, any help would be
appreciated.

Thanks

 
 
 

Symbol collisions

Post by Paul Pluzhniko » Sat, 28 Jun 2003 13:05:20



> I am having a problem on SOLARIS with symbol collision. I am building
> a server that links dynamically to two shared libraries which have the
> same symbol XMLReader. As a result of this symbol collision I get a
> segmentation violation.  These two libraries are third party libraries
> and therefore I do not have the source code to change the name.

Your first step is to complain loudly to the vendors of these
libraries -- there is really no excuse for not prefixing every
externally-visible symbol with VendorName_ (assuming the vendor
intends his library to be linked to customer code).

Quote:> If any
> one has dealt with these kind of situations, any help would be
> appreciated.

Your choices are quite limited, and depend on whether your code
needs access to either of these symbols. If not, you could try to
localize one (or both) of the symbols with 'objcopy -L XMLReader'

Cheers,
--
In order to understand recursion you must first understand recursion.

 
 
 

Symbol collisions

Post by Valentin Nechaye » Sat, 28 Jun 2003 15:07:48


P> I am having a problem on SOLARIS with symbol collision. I am building
P> a server that links dynamically to two shared libraries which have the
P> same symbol XMLReader. As a result of this symbol collision I get a
P> segmentation violation.  These two libraries are third party libraries
P> and therefore I do not have the source code to change the name. If any
P> one has dealt with these kind of situations, any help would be
P> appreciated.

RTLD_LOCAL and direct dlsym() for all used symbols.

-netch-

 
 
 

Symbol collisions

Post by Michael Bruschkewit » Tue, 08 Jul 2003 23:41:05



says...

> P> I am having a problem on SOLARIS with symbol collision. I am building
> P> a server that links dynamically to two shared libraries which have the
> P> same symbol XMLReader. As a result of this symbol collision I get a
> P> segmentation violation.  These two libraries are third party libraries
> P> and therefore I do not have the source code to change the name. If any
> P> one has dealt with these kind of situations, any help would be
> P> appreciated.

> RTLD_LOCAL and direct dlsym() for all used symbols.

wouldn't it be possible to use just the option "-M mapfile" for the
linker with mapfile =
{
        local:
                XMLReader;
        global:
                *;
Quote:}

and then dlsym() only for XMLReader ?

BTW, for the OP: "Linker and Libraries Guide" from AnswerBooks is very
helpful. Unfortunately, not _really_ easy to understood.

-mb

 
 
 

Symbol collisions

Post by Paul Pluzhniko » Wed, 09 Jul 2003 13:05:40



> wouldn't it be possible to use just the option "-M mapfile" for the
> linker with mapfile =

Not if the OP only has these libraries in the .so form:

Quote:> > P> These two libraries are third party libraries

Cheers,
--
In order to understand recursion you must first understand recursion.
 
 
 

1. Command for finding name or symbol collisions in libraries and object files.

Is there a utility on Solaris that can find if there are name or symbol
collisions between static libraries and object files.  For example, I
have a static library containing a number of functions and common
blocks.  I send this library to someone, who wish to link with it along
with several libraries or object files of their own.  I want to know if
their are any functions or common blocks with the same name in both
libraries since this presents a problem.  On IRIX there is a command
called collide which performs this operation.

I am also looking for a solution to the same problem on Linux systems.

Sent via Deja.com http://www.deja.com/
Before you buy.

2. benefit of static compile

3. SE toolkit collision stats vs. wire collision stats

4. Steve Chaney would love for you to call him at work

5. Problem with Apache + PHP4 DSO : symbol __muldi3: referenced symbol not found

6. network card and PnP help

7. Symbol xyz <> Symbol xyz!

8. Kernel configuration question

9. Solaris 2.5.1 symbol vsnprintf: referenced symbol not found

10. tdb_link error: "cg: cannot calculate difference between symbol ".L1 and symbol"

11. 2.5.73-bk5 -- intermezzo.ko needs unknown symbol set_fs_root, vga16fb.ko needs unknown symbol screen_info

12. ld.so.1: /opt/bin/apache/httpd: fatal: ... symbol ap_make_sub_pool: referenced symbol not found