Date: Sat, 26 Dec 2015 13:52:45 +0100 From: Ivan Radovanovic <radovanovic@gmail.com> To: Konstantin Belousov <kostikbel@gmail.com> Cc: freebsd-hackers@freebsd.org Subject: Re: Unexpected behavior of dynamic linker Message-ID: <567E8D9D.6080808@gmail.com> In-Reply-To: <20151226122818.GI3625@kib.kiev.ua> References: <567E810C.3040809@gmail.com> <20151226122818.GI3625@kib.kiev.ua>
index | next in thread | previous in thread | raw e-mail
On 12/26/15 13:28, Konstantin Belousov napisa:
>
> This is expected behaviour, it is mandated by the ELF standard. ELF
> tried to emulate the behaviour of the static libraries as much as possible.
> Think what would happen in your case if both modules where linked statically
> into the binary.
>
> To augment the behaviour, read about linker option -Bsymbolic, compiler
> option -fhidden, and GNU-specific attribute __visibility__("hidden").
>
Thanks for pointer about attributes (it does work as expected if I add
__attribute__((visibility("hidden"))) to private classes).
This behavior still looks counter-intuitive to me - like linker is
resolving already resolved reference, however problem is solved. Thanks!
home |
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?567E8D9D.6080808>
