Unexpected behavior of dynamic linker

Ivan Radovanovic radovanovic at gmail.com
Sat Dec 26 12:52:49 UTC 2015


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!


More information about the freebsd-hackers mailing list