Re: dlopen() sees some symbols, but not others




Paul Pluzhnikov wrote:

Finally, I added a call to FormatElement() to my stub module to
explicitly 'link it in', and now it's resolvable by dlopen().

That's consistent with FormatElement() having been GC'd,
until you added explicit reference for it ...


Interesting. Now that I dig further, I find a call to LogFormattedKey
from inside the main app, so I guess that function was there all along.
Odd, though, that since LogFormattedKey calls FormatElement, and the
code must be there, that symbol isn't exported. I guess the GC
algorithm's tricky.

Do you know of a way to bypass this symbol garbage collection? If
not, I can just change my dummy 'dllstub.c' module to make calls to all
the functions I want to force to be available, and I guess that'll
force them to be pulled in and exported via -bexpall.

By the way, is garbage collection only done for modules pulled in by
the linker from a library? If the .o's are explicitly fed to the
linker, are all functions in the .o's kept even if they're not
referenced by the app? The functions in my dllstub.c module are never
called - they're just there to provide references to other functions I
want included, so I'm guessing that the answer is yes.

Thanks,
Rob

.



Relevant Pages

  • Re: Abstract public member variales?
    ... every object that has ever come out of the factory persistent, ... Usually that is trivial because to pass the reference the message sender needs the reference in hand and it shouldn't have access to it after the object is deleted. ... GC causes more problems than it is worth and to be safe one should always invoke an explicit 'delete' method when an object's life cycle is done regardless of whether the language provides GC or not. ... since an object that is no longer useful can likely be safely deleted from the set of domain objects (ignoring persistence). ...
    (comp.object)
  • Re: Question on LSP
    ... not have to be explicit attributes, ... Since objects in memory usually don't move, the language can largely hide the identity mapping. ... My issue here is that whatever semantic meta model the language uses, there must be some way for the developer to unambiguously express the OOA/D is-a semantics for some problem space entity. ... Note that the language allows us to use a name like 'T' on the reference as a mnemonic so that the developer can keep track of what is happening with the indirection. ...
    (comp.object)
  • Re: Odd (undocumented?) behavior of RAM file within a loop
    ... use strict; use warnings; ... close statement (on AS Perl 5.10 on Win32). ... Note that the explicit close results in the reference to the same ...
    (comp.lang.perl.misc)
  • Re: The 198
    ... > In case you missed it: I don't accept a single one of your premises. ... I have made no claims about the book's status as a reference. ... > that the explicit statement on the back cover does not count, either, ... or a real mutant database. ...
    (rec.arts.comics.marvel.xbooks)
  • RE: File Closing Problem in 2.3 and 2.4, Not in 2.5
    ... File Closing Problem in 2.3 and 2.4, ... AND closing its open file. ... Only if the reference count is then zero will the ... We have retained the explicit file close in the current version of the Parser code. ...
    (comp.lang.python)