Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2013-01-02
22:20 • Closed ticket [3159088fff]: lazy bindings for dynamic loading plus 7 other c... artifact: 05581a1068 user: nijtmans
2012-11-08
19:24 • Open ticket [3159088fff]. artifact: 261d6cda69 user: nijtmans
2012-10-22
19:21 • Closed ticket [3159088fff]. artifact: dfbf2da035 user: nijtmans
13:59 • Ticket [3159088fff]: 1 change artifact: beca09bf77 user: nijtmans
2011-01-16
04:27 • New ticket [3159088fff]. artifact: 75cc5abe00 user: anyeli

lazy bindings for dynamic loading

Closed / Fixed3159088fffffffffffffffffffffffffffffffffCreated 16 years agoUpdated 14 years ago
Descriptionplain2011-01-16 04:27:59
I would like to have the option of having the dynamic loader perform lazy binding.

As of Tcl 8.5.9, the UNIX implementation of dynamic loading always passes RTLD_NOW to dlopen().
I want to build an extension that links to a dynamic library without having to link to an exact (or maximum)
version of the library.  With RTLD_NOW, if the library I link to is missing some symbols, I cannot load
the library at all if it is missing any symbols.  With RTLD_LAZY, I could link to the library missing symbols,
and avoid referencing them by using run-time version checks.  I do not know of a way of doing the same
thing with RTLD_NOW without a lot of extra work.
nijtmans Ticket [3159088fff]: 1 change [History diff]2012-10-22 13:59:45
nijtmansplain2012-10-22 19:21:49
allow_comments - 1

See: TIP #357 <http://tip.tcl.tk/357>

The "load" command is not meant to load external
libraries, only Tcl extensions. However using the TIP #357
Tcl_LoadFile (for the minimal required functions)
followed by Tcl_FindSymbol (for the optional symbols)
you should be able to do this. That's
the recommended way.
nijtmansplain2012-11-08 19:24:53
allow_comments - 0

See: <http://www.tcl.tk/cgi-bin/tct/tip/416>

The use case you are presenting is exactly one described in this TIP
nijtmansplain2013-01-02 22:20:06
allow_comments - 1

Fixed in Tcl 8.6
Log in (anonymous is fine) to add a comment.