[fpc-devel] Dynamically Loading Libraries
jonas.maebe at elis.ugent.be
Wed Nov 11 13:11:45 CET 2009
On 11 Nov 2009, at 11:54, Marco van de Voort wrote:
> In our previous episode, Jeppe Johansen said:
>>> This syntax is not possible. The external 'xxx' name 'proc' is
>>> there for a reason,
>>> for systems with multiple linker namespaces. Moreover there is
>>> already an
>>> enormous codebase that uses this.
>> I don't know if I'm making a fool of myself, but what systems?
>> the sources, I couldn't find any mention of it in the ELF writers. An
>> external symbol will simply be linked to the first occurrence of a
>> matching symbol in the first shared or static object(unless there's
>> name mangling going on that I didn't spot). The COFF writer already
>> it the way I suggested.
> Windows, Darwin, and afaik Solaris.
The library name is not used on Darwin. You also can't tell the static
linker that a name should only be looked up in a particular library.
It simply goes through all libraries/frameworks. Once it finds a
library/framework that contains the symbol, I think it does record in
the final binary from which library/framework the symbol comes though
(so that if at run time multiple libraries export the symbol, the same
one will always be chosen).
More information about the fpc-devel