st_writebinary(3) [ultrix man page]
stio(3) Library Functions Manual stio(3) Name st_readbinary, st_readst, st_writebinary, st_writest - routines that provide a binary read/write interface to the MIPS symbol table Syntax #include <syms.h> long st_readbinary (filename, how) char *filename; char how; long st_readst (fn, how, filebase, pchdr, flags) long fn; char how; long filebase; pCHDRR pchdr; long flags; void st_writebinary (filename, flags) char *filename; long flags; void st_writest (fn, flags) long fn; long flags; Description The CHDRR structure (see cmplrs/stsupport.h and the represents a symbol table in memory. A new CHDRR can be created by reading a symbol table in from disk. The st_readbinary and st_readst routines read a symbol table in from disk. The routine st_readbinary takes the file name of the symbol table and assumes the symbol table header (HDRR in sym.h occurs at the begin- ning of the file. The st_readst assumes that its file number references a file positioned at the beginning of the symbol table header and that the filebase parameter specifies where the object or symbol table file is based (for example, non-zero for archives). The second parameter to the read routines can be r for read only or a for appending to the symbol table. Existing local symbol, line, pro- cedure, auxiliary, optimization, and local string tables cannot be appended. If they didn't exist on disk, they can be created. This restriction stems from the allocation algorithm for those symbol table sections when read in from disk and follows the standard pattern for building the symbol table. The symbol table can be read incrementally. If pchdr is zero, st_readst assumes that a symbol table has not been read yet; therefore, it reads in the symbol table header and file descriptors. The flags argument is a bit mask that defines what other tables should be read. The t_p* constants for each table, defined in stsupport.h, can be ORed. If flags equals -1, all tables are read. If pchdr is set, the tables specified by flags are added to the tables that have already been read. The pchdr's value can be taken from st_current_pchdr. See Line number entries are encoded on disk; the read routines expand them to longs. If the version stamp is out of date, a warning message is issued to stderr. If the magic number in the HDRR is incorrect, st_error is called. All other errors cause the read routines to read non-zero; otherwise, a zero is returned. The routines st_writebinary and st_writest are symmetric to the read routines, excluding the how and pchdr parameters. The flags parameter is a bit mask that defines what table should be written. The st_p* constants for each table, defined in stsupport.h, can be ORed. If flags equals -1, all tables are written. The write routines write sections of the table in the approved order, as specified in the link editor specification. Line numbers are compressed on disk. The write routines start all sections of the symbol table on four-byte boundaries. If the write routines encounter an error, st_error is called. After writing the symbol table, further access to the table by other routines is undefined. See Also stcu(3), stfe(3), stfd(3), sym.h(5), sterror(5) stsupport.h(5) RISC stio(3)
Check Out this Related Man Page
stcu(3) Library Functions Manual stcu(3) Name stcu, st_cuinit, st_setchdr, st_currentpchdr, st_free, st_extadd, st_pext_iext, st_pext_rndx, st_iextmax, st_extstradd, st_str_extiss, st_idn_index_fext, st_idn_rndx, st_pdn_idn, st_rndx_idn, st_setidn - routines that provide a compilation unit symbol table interface Syntax #include <syms.h> pCHDRR st_cuinit () void st_setchdr (pchdr) pCHDRR pchdr; pCHDRR st_currentpchdr() void st_free() long st_extadd (iss, value, st, sc, index) long iss; long value; long st; long sc; long index; pEXTR st_pext_iext (iext) long iext; pEXTR st_pext_rndx (rndx) RNDXR rndx; long st_iextmax() long st_extstradd (str) char *str; char *st_str_extiss (iss) long iss; long st_idn_index_fext (index, fext) long index; long fext; long st_idn_rndx (rndx) RNDXR rndx; pRNDXR st_pdn_idn (idn) long idn; RNDXR st_rndx_idn (idn) long idn; void st_setidn (idndest, idnsrc) long idndest; long idnsrc; Description The stcu routines provide an interface to objects that occur once per object, rather than once per file descriptor (for example, external symbols, strings, and dense numbers). The routines provide access to the current chdr (compile time hdr), which represents the symbol ta- ble in running processes with pointers to symbol table sections rather than indices and offsets used in the disk file representation. A new symbol table can be created with st_cuinit. This routine creates and initializes a CHDRR (see cmplrs/stsupport.h). The CHDRR is the current chdr and is used in all later calls. A chdr can also be created with the read routines (see The st_cuinit routine returns a pointer to the new CHDRR record. st_currentchdr Returns a pointer the current chdr. st_setchdr Sets the current chdr to the pchdr argument and sets the per file structures to reflect a change in symbol tables. st_free Frees all constituent structures associated with the current chdr. st_extadd Lets you add to the externals table. It returns the index to the new external for future reference and use. The ifd field for the external is filled in by the current file (see For more details on the parameters, see sym.h. st_pext_iext and st_pext_rndx Returns pointers to the external, given a index referencing them. The latter routine requires a relative index where the index field should be the index in external symbols and the rfd field should be the constant ST_EXTIFD. NOTE: The externals contain the same structure as symbols (see the SYMR and EXTR definitions). st_iextmax Returns the current number of entries in the external symbol table. The iss field in external symbols (the index into string space) must point into external string space. st_extstradd Adds a null-terminated string to the external string space and returns its index. st_str_extiss Converts that index into a pointer to the external string. The dense number table provides a convenience to the code optimizer, generator, and assembler. This table lets them reference symbols from different files and externals with unique densely packed numbers. st_idn_index_fext Returns a new dense number table index, given an index into the symbol table of the current file (or if fext is set, the externals table). st_idn_rndx Returns a new dense number, but expects a RNDXR (see sym.h to specify both the file index and the symbol index rather than implying the file index from the current file. The RNDXR contains two fields: an index into the externals table and a file index rsyms can point into the symbol table, as well). The file index is ST_EXTIFD (see stsupport.h) for externals. st_rndx_idn Returns a RNDX, given an index into the dense number table. st_pdn_idn Returns a pointer to the RNDXR index by the idn argument. See Also stfe(3), stfd(3) RISC stcu(3)