LDGETNAME(3x,L) AIX Technical Reference LDGETNAME(3x,L)
-------------------------------------------------------------------------------
ldgetname
PURPOSE
Retrieves the symbol name for a common object file symbol table entry.
LIBRARY
Object File Access Routine Library (libld.a)
SYNTAX
#include <stdio.h>
#include <filehdr.h>
#include <syms.h>
#include <ldfcn.h>
char *ldgetname (ldptr, symbol)
LDFILE *ldptr;
SYMENT *symbol;
DESCRIPTION
The ldgetname subroutine returns a pointer to the name associated with symbol
as a string. The string is contained in a static buffer local to ldgetname
that is overwritten by each call to ldgetname, and therefore, must be copied by
the caller if the name is to be saved.
The common object file format handles arbitrary length symbol names with the
addition of a string table. The ldgetname subroutine returns the symbol name
associated with a symbol table entry for either a pre-COFF-format object file
or a COFF-format object file. Thus, ldgetname can be used to retrieve names
from object files without any backward compatibility problems. The ldgetname
subroutine returns NULL (which is defined in the file stdio.h) for a
COFF-format object file, if the name cannot be retrieved. This situation can
occur:
o If the string table cannot be found
o If not enough memory can be allocated for the string table
o If the string table appears not to be a string table (for example if an
auxiliary entry is handed to ldgetname that looks like a reference to a
name in a non-existent string table)
o If the name's offset into the string table is past the end of the string
table.
Processed November 7, 1990 LDGETNAME(3x,L) 1
LDGETNAME(3x,L) AIX Technical Reference LDGETNAME(3x,L)
Typically, ldgetname is called immediately after a successful call to ldtbread
to retrieve the name associated with the symbol table entry filled by ldtbread.
RELATED INFORMATION
In this book: "ldclose, ldaclose," "ldfcn," "ldopen, ldaopen," "ldtbread," and
"ldtbseek."
Processed November 7, 1990 LDGETNAME(3x,L) 2