Tcl Source Code

View Ticket
Login
Ticket UUID: 3545876
Title: tclLoadDyld.c deprecations
Type: Bug Created on: 2012-07-19 13:44:58
Submitter: dgp Assigned to: aku
Subsystem: 40. Dynamic Loading Severity: Minor
Priority: 5 Medium Last modified: 2026-10-29 01:20:01
Status: Open Closed by: nobody
Resolution: None Closed on:
Version: obsolete: 8.5.12
Description:
Forwarded from Gustaf Neumann:

% clang --version
Apple clang version 3.1 (tags/Apple/clang-318.0.58) (based on LLVM 3.1svn)
...
/usr/local/src/tcl8.5.12/unix/../unix/tclLoadDyld.c:386:17: warning: 'NSLookupSymbolInImage' is deprecated [-Wdeprecated-declarations]
             nsSymbol = NSLookupSymbolInImage(dyldLoadHandle->dyldLibHeader,
                        ^
/usr/local/src/tcl8.5.12/unix/../unix/tclLoadDyld.c:419:3: warning: 'NSLinkEditError' is deprecated [-Wdeprecated-declarations]
                 NSLinkEditError(&editError, &errorNumber, &errorName, &errMsg);
                 ^
/usr/local/src/tcl8.5.12/unix/../unix/tclLoadDyld.c:423:17: warning: 'NSLookupSymbolInModule' is deprecated [-Wdeprecated-declarations]
             nsSymbol = NSLookupSymbolInModule(
                        ^
/usr/local/src/tcl8.5.12/unix/../unix/tclLoadDyld.c:432:13: warning: 'NSAddressOfSymbol' is deprecated [-Wdeprecated-declarations]
             proc = NSAddressOfSymbol(nsSymbol);
                    ^
/usr/local/src/tcl8.5.12/unix/../unix/tclLoadDyld.c:497:15: warning: 'NSUnLinkModule' is deprecated [-Wdeprecated-declarations]
             result = NSUnLinkModule(modulePtr->module,
                      ^
/usr/local/src/tcl8.5.12/unix/../unix/tclLoadDyld.c:701:12: warning: 'NSCreateObjectFileImageFromMemory' is deprecated [-Wdeprecated-declarations]
             err = NSCreateObjectFileImageFromMemory(buffer, codeSize,
                   ^
/usr/local/src/tcl8.5.12/unix/../unix/tclLoadDyld.c:734:14: warning: 'NSLinkModule' is deprecated [-Wdeprecated-declarations]
     module = NSLinkModule(dyldObjFileImage, "[Memory Based Bundle]",
              ^
/usr/local/src/tcl8.5.12/unix/../unix/tclLoadDyld.c:736:5: warning: 'NSDestroyObjectFileImage' is deprecated [-Wdeprecated-declarations]
     NSDestroyObjectFileImage(dyldObjFileImage);
     ^
/usr/local/src/tcl8.5.12/unix/../unix/tclLoadDyld.c:744:2: warning: 'NSLinkEditError' is deprecated [-Wdeprecated-declarations]
         NSLinkEditError(&editError, &errorNumber, &errorName, &errMsg);
         ^
9 warnings generated.

Not immediately critical, but might be a warning we need to react
to as we move forward.

More information found at:
http://www.mulle-kybernetik.com/weblog/2010/01/
User Comments:
chrstphrchvz added on 2026-10-29 01:20:01:

Usage of these functions is still present, but their deprecation warnings have been suppressed since [4760483b] (8.5.19 and 8.6.5).

My impression is that usage of these functions is not strictly necessary and possibly no longer beneficial.

  • NSCreateObjectFileImageFromMemory() was intentionally deprecated without replacement due to security concerns. The remaining deprecated functions were replaced by macOS 10.5's improved dlopen(), dlsym(), dlclose(), and dlerror().
  • NSLinkModule() reportedly loads "in-memory" code from a temporary file anyway on recent macOS versions.
  • NSLookupSymbolInImage() reportedly no longer works on recent macOS versions.

So I think removing usage of these functions is likely a good idea, and since TCL_LOAD_FROM_MEMORY was only ever implemented on Darwin, all code related to it could be removed from Tcl.