Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ ldgetname(S) — OpenDesktop Software Development System 3.0.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ldfcn(FP)

ldtbindex(S)

ldtbread(S)

ldtbseek(S)


 ldgetname(S)                   6 January 1993                   ldgetname(S)


 Name

    ldgetname - retrieve symbol name for common object file symbol table
    entry

 Syntax


    cc  . . .  -lld


    #include <filehdr.h>
    #include <syms.h>
    #include <ldfcn.h>

    char *ldgetname (ldptr, symbol)
    LDFILE *ldptr;
    SYMENT *symbol;


 Description

    The ldgetname function returns a pointer to the name associated with sym-
    bol 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 ldgetname function can be used to retrieve names from object files
    without any backward compatibility problems.  The ldgetname function
    returns NULL (defined in stdio.h) for an object file if the name cannot
    be retrieved.  This situation can occur:

    +  if the ``string table'' cannot be found,

    +  if not enough memory can be allocated for the string table,

    +  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 nonexistent string table), or

    +  if the name's offset into the string table is past the end of the
       string table.

    Typically, ldgetname is called immediately after a successful call to
    ldtbread to retrieve the name associated with the symbol table entry
    filled by ldtbread.

 See also

    ldfcn(FP), ldtbindex(S), ldtbread(S), ldtbseek(S)

 Standards conformance

    ldgetname is not part of any currently supported standard; it is an
    extension of AT&T System V provided by the Santa Cruz Operation.


Typewritten Software • bear@typewritten.org • Edmonds, WA 98026