[fpc-pascal] Shared libraries and threadvars

Mark Morgan Lloyd markMLl.fpc-pascal at telemetry.co.uk
Wed Jun 27 10:44:34 CEST 2012


 >> Can such an alternative entry point in the main unit be called by
 >> a shared library, i.e. either resolved at load time or with the main
 >> binary reopened like a library? Or is the only way to pass a main-
 >> program entry point to a shared library by using it as a parameter
 >> to a procedure?

 > I can't tell you for *nix systems as I'm not experienced enough
 > regarding their dynamic linkers,

Superficial testing suggests that if the code in a .so (Linux, i386) 
tries to call an "extra" entry point exported from the main program, 
that a run-time (libdl) load of the library will fail. I'll keep on 
tinkering with this, I've not yet retrieved the exact error message and 
I'm interested in seeing what happens if the .so itself tries to use 
libdl to reopen the main program.

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]



More information about the fpc-pascal mailing list