On Thu, Sep 20, 2007 at 09:57:23PM +0200, Jozef Kruger wrote:
> Since the system and host modules are compiled into shared libraries
> I would expect that they end up calling the print function defined
> in their own module (since those references have been resolved
> already, both shared objects contain no undefined reference to
> "print").

No.  All dynamic references to a function named print will resolve to
one copy.  If you linked the application with -rdynamic, it would be
that copy.

You can get the results you expect by using a linker script, or
GCC's __attribute__((hidden)) or -fvisibility=hidden.  This is a
difference between ELF linkage and Windows-style DLL linkage.


-- 
Daniel Jacobowitz
CodeSourcery


_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to