Josselin Mouette schrieb:
> Le vendredi 28 septembre 2007 à 11:43 +0200, Michael Biebl a écrit :
>>> To avoid weird crashes caused by namespace conflicts, libtrackerclient
>>> should be built with LDFLAGS += -Wl,-Bsymbolic.
>> Hi Joss,
>>
>> the ld manpage was not particularly helpful regarding this topic. Could
>> you please elobarate a bit more what -Bsymbolic does, why it is needed
>> and if it has any downsides.
> 
> Hi,
> 
> this will avoid a kind of horrible bugs we have met with some GTK+ theme
> engines.
> 
> Let's say that libtrackerclient contains symbol foo - even if isn't part
> of the public ABI. If there is a function named foo in a binary linked
> to libtracker, calls to foo in other libtrackerclient functions will
> instead use the binary's foo symbol.
> 
> If the client is directly linked to the library, this behavior is
> desirable, so that foo can be overridden. If there is something wrong
> with this override, it will fail in all cases and will be quickly
> spotted.
> 
> However, as the library is dlopen()ed, it has the potential to come in
> the global symbol table of virtually any GTK+ application, but not all
> the time. If for some reason, another binary has a symbol named foo
> which has nothing to do with libtrackerclient's foo, it will be used
> instead and will lead to bugs that are very hard to understand and
> reproduce as the stack looks corrupt and the library is not always
> dlopen()ed.
> 
> This is why it is a good idea for *all* Pango and GTK+ plugins to be
> linked with -Bsymbolic. This option guarantees that a function in
> libtrackerclient that calls "foo" will obtain the function "foo" defined
> in libtrackerclient, nothing else.
> 

There are also clients which directly link against libtrackerclient
(like nautilus or tracker-search-tool). Would this have a negative
effect for them?

Cheers,
Michael

-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to