[Top][All Lists]

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

Re: shared lib relocation problem

From: Daniel Jacobowitz
Subject: Re: shared lib relocation problem
Date: Fri, 21 Sep 2007 21:30:15 -0400
User-agent: Mutt/1.5.15 (2007-04-09)

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

reply via email to

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