VxWorks Reference Manual : Libraries

unldLib

NAME

unldLib - object module unloading library

ROUTINES

unld( ) - unload an object module by specifying a file name or module ID
unldByModuleId( ) - unload an object module by specifying a module ID
unldByNameAndPath( ) - unload an object module by specifying a name and path
unldByGroup( ) - unload an object module by specifying a group number
reld( ) - reload an object module

DESCRIPTION

This library provides a facility for unloading object modules. Once an object module has been loaded into the system (using the facilities provided by loadLib), it can be removed from the system by calling one of the unld...( ) routines in this library.

Unloading of an object module does the following:

(1)
It frees the space allocated for text, data, and BSS segments, unless loadModuleAt( ) was called with specific addresses, in which case the user is responsible for freeing the space.

(2)
It removes all symbols associated with the object module from the system symbol table.

(3)
It removes the module descriptor from the module list.

Once the module is unloaded, any calls to routines in that module from other modules will fail unpredictably. The user is responsible for ensuring that no modules are unloaded that are used by other modules. unld( ) checks the hooks created by the following routines to ensure none of the unloaded code is in use by a hook:

    taskCreateHookAdd( )
    taskDeleteHookAdd( )
    taskHookAdd( )
    taskSwapHookAdd( )
    taskSwitchHookAdd( )

However, unld( ) does not check the hooks created by these routines:

    etherInputHookAdd( )
    etherOutputHookAdd( )
    excHookAdd( )
    rebootHookAdd( )
    moduleCreateHookAdd( )

INCLUDE FILES

unldLib.h, moduleLib.h

SEE ALSO

unldLib, loadLib, moduleLib, Tornado User's Guide: Cross-Development


Libraries : Routines

unld( )

NAME

unld( ) - unload an object module by specifying a file name or module ID

SYNOPSIS

STATUS unld
    (
    void * nameOrId, /* name or ID of the object module file */
    int    options
    )

DESCRIPTION

This routine unloads the specified object module from the system. The module can be specified by name or by module ID. For a.out and ECOFF format modules, unloading does the following:

(1)
It frees the space allocated for text, data, and BSS segments, unless loadModuleAt( ) was called with specific addresses, in which case the user is responsible for freeing the space.

(2)
It removes all symbols associated with the object module from the system symbol table.

(3)
It removes the module descriptor from the module list.

For other modules of other formats, unloading has similar effects.

Before any modules are unloaded, all breakpoints in the system are deleted. If you need to keep breakpoints, set the options parameter to UNLD_KEEP_BREAKPOINTS. No breakpoints can be set in code that is unloaded.

RETURNS

OK or ERROR.

SEE ALSO

unldLib, VxWorks Programmer's Guide: Target Shell, windsh, Tornado User's Guide: Shell


Libraries : Routines

unldByModuleId( )

NAME

unldByModuleId( ) - unload an object module by specifying a module ID

SYNOPSIS

STATUS unldByModuleId
    (
    MODULE_ID moduleId, /* module ID to unload */
    int       options
    )

DESCRIPTION

This routine unloads an object module that has a module ID matching moduleId.

See the manual entries for unld( ) or unldLib for more information on module unloading.

RETURNS

OK or ERROR.

SEE ALSO

unldLib, unld( )


Libraries : Routines

unldByNameAndPath( )

NAME

unldByNameAndPath( ) - unload an object module by specifying a name and path

SYNOPSIS

STATUS unldByNameAndPath
    (
    char * name,   /* name of the object module to unload */
    char * path,   /* path to the object module to unload */
    int    options /* options, currently unused */
    )

DESCRIPTION

This routine unloads an object module specified by name and path.

See the manual entries for unld( ) or unldLib for more information on module unloading.

RETURNS

OK or ERROR.

SEE ALSO

unldLib, unld( )


Libraries : Routines

unldByGroup( )

NAME

unldByGroup( ) - unload an object module by specifying a group number

SYNOPSIS

STATUS unldByGroup
    (
    UINT16 group,  /* group number to unload */
    int    options /* options, currently unused */
    )

DESCRIPTION

This routine unloads an object module that has a group number matching group.

See the manual entries for unld( ) or unldLib for more information on module unloading.

RETURNS

OK or ERROR.

SEE ALSO

unldLib, unld( )


Libraries : Routines

reld( )

NAME

reld( ) - reload an object module

SYNOPSIS

MODULE_ID reld
    (
    void * nameOrId, /* name or ID of the object module file */
    int    options   /* options, currently unused */
    )

DESCRIPTION

This routine unloads a specified object module from the system, and then calls ld( ) to load a new copy of the same name.

If the file was originally loaded using a complete pathname, then reld( ) will use the complete name to locate the file. If the file was originally loaded using a partial pathname, then the current working directory must be changed to the working directory in use at the time of the original load.

RETURNS

A module ID (type MODULE_ID), or NULL.

SEE ALSO

unldLib, unld( )