ldgetname(3) — Subroutines
NAME
ldgetname − retrieve symbol name for object file symbol table entry
SYNOPSIS
#include <stdio.h>
#include <filehdr.h>
#include <sym.h>
#include <ldfcn.h> char ∗ldgetname(
LDFILE ∗ ldptr,
pSYMR ∗ symbol );
DESCRIPTION
The ldgetname() routine returns a pointer to the name associated with symbol. The pointer is returned as a string in a static buffer. Because the buffer can be overwritten by later calls to ldgetname(), the caller must copy the buffer if the name is to be saved.
If the name cannot be retrieved, ldgetname() returns NULL (defined in <stdio.h>) for an object file. This occurs when:
•The string table cannot be found
•The name’s offset into the string table is beyond the end of the string table
Typically, ldgetname() is called immediately after a successful call to ldtbread(). It retrieves the name associated with the symbol table entry filled by ldtbread().
The program must be loaded with the object file access routine library libmld.a.
[Tru64 UNIX] For C++, ldgetname() returns the demangled name.