ldtbindex Subroutine

Purpose

Computes the index of a symbol table entry of a common object file.

Library

Object File Access Routine Library (libld.a)

Syntax

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

long ldtbindex ( ldPointer)
LDFILE *ldPointer;

Description

The ldtbindex subroutine returns the index of the symbol table entry at the current position of the common object file associated with the ldPointer parameter.

The index returned by the ldtbindex subroutine may be used in subsequent calls to the ldtbread subroutine. However, since the ldtbindex subroutine returns the index of the symbol table entry that begins at the current position of the object file, if the ldtbindex subroutine is called immediately after a particular symbol table entry has been read, it returns the index of the next entry.

Parameters

Item Description
ldPointer Points to the LDFILE structure that was returned as a result of a successful call to the ldopen or ldaopen subroutine.

Return Values

The ldtbindex subroutine returns the value BADINDEX upon failure. Otherwise a value greater than or equal to zero is returned.

Error Codes

The ldtbindex subroutine fails if there are no symbols in the object file or if the object file is not positioned at the beginning of a symbol table entry.

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