              <<< NOTED::NOTES$7:[NOTES$LIBRARY]HACKERS.NOTE;1 >>>
                               -< ** Hackers ** >-
================================================================================
Note 1832.8                     ldr$unload_image                         8 of 15
UTRTSC::VDBURG "Change mode to PANIC"                21 lines  27-MAR-1997 01:39
                            -< It can be done.... >-
--------------------------------------------------------------------------------
    Well, you can load as well as unload. Some time ago i created some
    stuff to load and unload a module on the fly. The main routine to do
    the processing is called from macro and written in C, it was some
    process state monitor. The problem i ran into was that real dynamic
    unloading support is not compiled in the VMS kernel. I don't have the
    right details in my head, but you should be able to specify an unload
    routine in a seprarate psect, and by specifying a flag it should be
    called. But this code is currently not included in the kernel.
    
    The next replies contain example code.
    
    .+1 = BUILD.COM, the build procedure
    .+2 = ARCH.MAR, used for conditional compilation for Vax or Alpha
    .+3 = SMON.MAR, the main routine
    .+4 = SMONLOAD.C, the dynamic loader
    .+5 = SMONUNLOAD.C, the dynamic unloader
    .+6 = PROCPROC.C, the C routine called by the main routine to do
    some processing.
    
    Jur.
    
