bug-gnu-utils
[Top][All Lists]
Advanced

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

Bug: dynamic symbols in shared libs??


From: Jorge Luis Williams
Subject: Bug: dynamic symbols in shared libs??
Date: Wed, 17 Jul 2002 15:17:14 -0700
User-agent: Mutt/1.2.5.1i

 
 I have three libraries lib_b, lib_c, lib_c_copy. lib_c and lib_c_copy
 both define the same dynamic symbols. In fact they are true copies --
 generated from the same code.
  
  
  exe_a is dynamicly linked to lib_c and lib_b
  lib_b is dynamicly linked to lib_c_copy
  
  
  It seems that when I run exe_a both exe_a and lib_b use the same copy of
  lib_c which causes some problems for what I'm trying to do.   I've tried
  linker flag -Bsymbolic which I understood would prevent this from
  happening, but this doesn't seem to work.
  
  Another technique is statically linking exe_a to lib_c and lib_b to
  lib_c_copy. This works under linux -- however it's not enough to fool the
  dynamic linker/loader under solaris as here we still use the same copy of
  lib_c.

H.J. from the binutils mailing list recomended:
> 
> 
> # gcc -o exe_a .... -l_c
> # gcc -shared -Wl,-Bsymbolic -o lib_b.so .... -l_c
> 
> It should work. If not, file a bug report with a small testcase.
> 
> 
> H.J.

This didn't work either -- I'm generating some undefined symbol
warnings. I'm attaching a test case with the example listed above and
a simple makefile that shows how I build. Please keep in mind that I'm
compiling under Sun so I need to use -fPIC, but this doesn't also
work under Linux.


Thanx,

jOrGe W.



reply via email to

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