nld Manual

nld Manual528272-001
C-1
C Native Object File Structure
The nld utility operates on native object files, which have four main components:
Headers of these types, which contain information about the structure and
components of the object file:
°
File
°
Program
°
Section
Code and Data Segments on page C-1
MDEBUG Section on page C-2
TANDEM_GINFO section, which contains information used by the operating
system to load loadfiles (for example, a lists of unresolved references and
procedure information for creating run-time stack traces)
Code and Data Segments
The code segments of an object file contain the code for procedures and
subprocedures. In relinkable object files, resident and nonresident procedures are
intermixed in the file. In loadfiles, resident and nonresident procedures are in separate
code segments.
The data segments of an object file contain information, such as global variables in
pTAL and extern and static variables in C, that does not appear and disappear
with each invocation of a procedure or subprocedure. The compilers generate code
that uses the run-time stack to manage data that does appear and disappear.
Code and data segments are divided into sections. nld operates on sections for
linking, whereas the operating system operates on segments for loading programs into
virtual memory. Table C-1 on page C-1 lists the sections within each segment:
Shared run-time libraries (SRLs) and programs with callable procedures contain
additional sections and segments.
Table C-1. Loadfile Segments and Sections
Segments Sections
Code Nonresident Text
Resident Text
Read-only Data
Data Large Initialized Data
Small Initialized Data
Small Uninitialized Data
Large Uninitialized Data