[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Technical Reference: Base Operating System and Extensions, Volume 1

ldtbread Subroutine


Reads an indexed symbol table entry of a common object file.


Object File Access Routine Library (libld.a)


#include <stdio.h>
#include <ldfcn.h>

int ldtbread ( ldPointer, SymbolIndex, Symbol)
LDFILE *ldPointer;
long SymbolIndex;
void *Symbol;


The ldtbread subroutine reads the symbol table entry specified by the SymbolIndex parameter of the common object file currently associated with the ldPointer parameter into the area of memory beginning at the Symbol parameter. It is the responsibility of the calling routine to provide a pointer to a buffer large enough to contain the symbol table entry of the associated object file. Since the ldopen subroutine provides magic number information (via the HEADER(ldPointer).f_magic macro), the calling application can always determine whether the Symbol pointer should refer to a 32-bit SYMENT or 64-bit SYMENT_64 structure.


ldPointer Points to the LDFILE structure that was returned as the result of a successful call to the ldopen or ldaopen subroutine.
SymbolIndex Specifies the index of the symbol table entry to be read.
Symbol Points to a either a 32-bit or a 64-bit SYMENT structure.

Return Values

The ldtbread subroutine returns a SUCCESS or FAILURE value.

Error Codes

The ldtbread subroutine fails if the SymbolIndex parameter is greater than or equal to the number of symbols in the object file, or if it cannot read the specified symbol table entry.

The first symbol in the symbol table has an index of 0.

Related Information

The ldahread (ldahread Subroutine) subroutine, ldfhread (ldfhread Subroutine) subroutine, ldgetname (ldgetname Subroutine) subroutine, ldlread, ldlinit, or ldlitem (ldlread, ldlinit, or ldlitem Subroutine) subroutine, ldshread or ldnshread (ldshread or ldnshread Subroutine) subroutine.

Subroutines, Example Programs, and Libraries in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]