#include <stdio.h> #include <filehdr.h> #include <scnhdr.h> #include <syms.h> #include <ldfcn.h> int ldshread (ldptr, sectindx, secthead) LDFILE *ldptr; unsigned short sectindx; SCNHDR *secthead; int ldnshread (ldptr, sectname, secthead) LDFILE *ldptr; char *sectname; SCNHDR *secthead;
ldshread reads the section header specified by sectindx of the common object file currently associated with ldptr into the area of memory beginning at secthead.
ldnshread reads the section header specified by sectname into the area of memory beginning at secthead.
ldshread and ldnshread return SUCCESS or FAILURE. If sectindx is greater than the number of sections in the object file, ldshread fails; If there is no section name corresponding with sectname, ldnshread fails. If it cannot read the specified section header, either function fails.
NOTE: The first section header has an index of one.
The program must be loaded with the object file access routine library libmld.a.
ldclose(3), ldopen(3), ldfcn(4). delim off