Symbol Table and Object File Access Library (libst.a)
st_status_t st_obj_open (
const char *name,
unsigned int flags );
st_status_t st_obj_close (
st_obj_t *obj );
st_status_t st_object_type (
const char *name,
st_object_type_t *otype );
Specifies an address to which st_obj_open returns an object handle if it successfully opens the file specified in the name parameter. For st_obj_close, specifies an object handle, as returned by the st_obj_open function. Specifies the file name of the object to be opened or closed, or for which an object type is requested. Specifies how the object is to be opened. The open flags defined in /usr/include/st.h include the following: Opens the file for read-only access. This is the default. Disables name demangling for C++ names. By default, C++ name demangling is enabled when a file is opened. Specifies an address to which st_object_type returns a value identifying the object type. The following object types are defined in usr/include/st.h: Unknown object type Archive library OMAGIC file NMAGIC file ZMAGIC file
The st_obj_open function opens the named object file for read access. It maps the file in memory using mmap, if possible. If mmap fails, it dynamically allocates memory in which to read the file. The flags parameter indicates how the file is to be opened. If it succeeds in opening the file, it returns an opaque handle for the object to the obj parameter. You can use this object handle as an input argument in subsequent calls to other object file access routines.
The st_obj_close function releases memory dynamically allocated for processing the object and unmaps memory to which the file was mapped when it was opened.
The st_object_type function returns the object type of the specified filename object to the otype parameter. st_object_type does not create an object handle, nor does it open the object.
All functions indicate success by returning a value of 0 (zero). A positive return value is an errno value from a system call. A negative return value is a library error or informational code. The library codes are documented in st.h.
Return parameters are set to 0 or -1 when an error occurs. Address parameters are set to 0, and file and procedure handles are set to -1. An exception to this is if a NULL pointer for the object or other return parameter is input. In these cases, the return parameters will be unchanged. A non-zero return status is the recommended method for detecting an error return from a libst function.
Header file that contains all definitions and function prototypes for libst.a functions Header file that controls name-demangling operations for C++ objects
Functions: mmap(2), libst_intro(3), st_addr_to_file(3), st_file_lang(3), st_obj_file_start(3), st_objlist_append(3), st_proc_addr(3), st_sym_value(3) delim off