[ Previous | Next | Contents | Glossary | Home | Search ]
AIX Version 4.3 Base Operating System and Extensions Technical Reference, Volume 1

ldshread or ldnshread Subroutine

Purpose

Reads an indexed or named section header of a common object file.

Library

Object File Access Routine Library (libld.a)

Syntax

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

int ldshread (ldPointer, SectionIndex, SectionHead)
LDFILE *ldPointer;
unsigned short SectionIndex;
SCNHDR *SectionHead;

int ldnshread (ldPointer, SectionName, SectionHead)
LDFILE *ldPointer;
char *SectionName;
SCNHDR *SectionHead;

Description

The ldshread subroutine reads the section header specified by the SectionIndex parameter of the common object file currently associated with the ldPointer parameter into the area of memory beginning at the location specified by the SectionHead parameter.

The ldnshread subroutine reads the section header specified by the SectionName into the area of memory beginning at the location specified by the SectionHead parameter.

Parameters

ldPointer Points to the LDFILE structure that was returned as the result of a successful call to ldopen or ldaopen subroutine.
SectionIndex Specifies the index of the section header to be read.
SectionHead Specifies the name of the section header to be read.
SectionName Points to a SCNHDR structure.

Return Values

The ldshread and ldnshread subroutines return a success or failure value.

Error Codes

The ldshread subroutine fails if the SectionIndex parameter is greater than the number of sections in the object file. The ldnshread subroutine fails if there is no section name corresponding with the SectionName parameter. Either function fails if it cannot read the specified section header.

Note: The first section has an index of 1.

Implementation Specifics

These subroutines are part of Base Operating System (BOS) Runtime.

Related Information

The ldahread subroutine, ldfhread subroutine, ldgetname subroutine, ldlread, ldlinit, or ldlitem subroutine, ldtbread subroutine.

Subroutines Overview in AIX Version 4.3 General Programming Concepts: Writing and Debugging Programs.


[ Previous | Next | Contents | Glossary | Home | Search ]