Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ldtbread(3) [osf1 man page]

ldtbread(3)						     Library Functions Manual						       ldtbread(3)

NAME
ldtbread - Read an indexed symbol table entry of a common object file SYNOPSIS
#include <stdio.h> #include <filehdr.h> #include <syms.h> #include <ldfcn.h> int ldtbread (ldptr, symindex, symbol) LDFILE *ldptr ; long symindex ; pSYMR *symbol ; DESCRIPTION
The ldtbread routine reads the symbol table entry specified by symindex of the common object file currently associated with ldptr into the area of memory beginning at symbol. It returns SUCCESS or FAILURE. If symindex is greater than the number of symbols in the object file or if it cannot read the specified symbol table entry, ldtbread fails. The local and external symbols are concatenated into a linear list. Symbols are accessible from symbol index zero to SYM- HEADER(ldptr).isymMax + SYMHEADER(ldptr).iextMax. The index and iss fields of the SYMR are made absolute (rather than file relative) so that the routines ldgetname(3), ldgetaux(3), and ldtbread proceed normally given those indices. Only the SYMR part of the external symbol structure is returned. NOTE: The first symbol in the symbol table has an index of zero. The program must be loaded with the object file access routine library libmld.a. RELATED INFORMATION
ldclose(3), ldgetname(3), ldopen(3), ldtbseek(3), ldgetname(3), ldfcn(4). delim off ldtbread(3)

Check Out this Related Man Page

ldopen(3)						     Library Functions Manual							 ldopen(3)

NAME
ldopen, ldaopen - open a common object file for reading LIBRARY
libmld.a SYNOPSIS
#include <stdio.h> #include <filehdr.h> #include <syms.h> #include <ldfcn.h> LDFILE *ldopen (filename, ldptr) char *filename; LDFILE *ldptr; LDFILE *ldaopen (filename, oldptr) char *filename; LDFILE *oldptr; ldreadst (ldptr, flags) LDFILE *ldptr; int flags; DESCRIPTION
The ldopen and ldclose(3) routines provide uniform access to simple object files and to object files that are members of archive files. An archive of common object files can be processed as if it were a series of simple common object files. If ldptr has the value NULL, ldopen opens filename, allocates and initializes the LDFILE structure, and returns a pointer to the structure to the calling program. If ldptr is valid and TYPE(ldptr) is the archive magic number, ldopen reinitializes the LDFILE structure for the next archive member of filename. ldopen and ldclose work in concert. ldclose returns FAILURE only when TYPE(ldptr) is the archive magic number and there is another file in the archive to be processed. Only then should ldopen be called with the current value of ldptr. In all other cases, and particularly when a new filename is opened, ldopen should be called with a NULL ldptr argument. The following is a prototype for the use of ldopen and ldclose: /* for each filename to be processed */ ldptr = NULL; do if ( (ldptr = ldopen(filename, ldptr)) != NULL ) { /* check magic number */ /* process the file */ } } while (ldclose(ldptr) == FAILURE ); If the value of oldptr is not NULL, ldaopen opens filename anew and allocates and initializes a new LDFILE structure, copying the fields from oldptr. ldaopen returns a pointer to the new LDFILE structure. This new pointer is independent of the old pointer, oldptr. The two pointers can be used concurrently to read separate parts of the object file. For example, one pointer can be used to step sequentially through the relocation information while the other is used to read indexed symbol table entries. The ldopen function and ldaopen open filename for reading. If filename cannot be opened or if memory for the LDFILE structure cannot be allocated, both functions return NULL. A successful open does not ensure that the given file is a common object file or an archived object file. The ldopen function causes the symbol table header and file descriptor table to be read. Further access, using ldptr, causes other appro- priate sections of the symbol table to be read (for example, if you call ldtbread, the symbols or externals are read). To force sections for the symbol table in memory, call ldreadst with ST_P* constants ORed together from st_support.h. The program must be loaded with the object file access routine library libmld.a. RELATED INFORMATION
fopen(3), ldclose(3), ldfcn(4). delim off ldopen(3)
Man Page