Table of Contents

Advertisement

TNS/E Native Object Files

User Code

In linkfiles there can be many text sections. The sections whose names begin .text
contain procedures and subprocedures that are not resident. The sections whose
names begin .restext contain procedures and subprocedures that are resident.
When the linker is building a new linkfile it concatenates each of the text sections from
the various input files into a section of the same name in the output file. On the other
hand, in loadfiles, all the non-resident code is combined into a single .text section, and
all the resident code into a single .restext section. The text sections of a loadfile may
also contain linker-generated branch stubs, which are not present in linkfiles.
Some procedures are global, which means their names are meaningful across
separate compilations. All references to global procedures must be marked with
relocation table entries. When there are duplicate copies of global procedures, the
linker picks one to use, and the relocation table entries are used by the linker to make
sure all references go to the copy that was picked.
If a procedure is in a section whose name begins either ".text." or ".restext.", and the
rest of the name is the same as that of the procedure, this is an indication by the
compiler that, if this is an unused copy of the procedure, then in fact the entire section
containing it may be ignored by the linker. In that case, the linker ignores that input
section, thus making the resulting code space smaller.
The .procnames and .procinfo sections provide additional information about
procedures and subprocedures in linkfiles. See
and Subprocedures in Linkfiles
The size of executable code is always a multiple of 16 bytes, because instructions are
grouped into 128-bit bundles. Actually, the HP NonStop operating system compilers
usually say that text sections must be aligned on 32-byte boundaries, and similarly
each procedure within a code section starts at an offset within that section that is a
multiple of 32 bytes. Larger alignments can also be specified in assembler source
files. When space is wasted between procedures, the assembler fills that space with
no-ops.
The total size of a text section in any linkfile must not exceed 16 MB, so that the linker
can add branch stubs to the section if necessary. Also, it is suggested that compilers
not put all the code of a compilation into one code section, but rather divide it into
multiple code sections, such as by putting each procedure into its own section. That is
a way to avoid running into the 16 MB limit, either directly as the result of a
compilation, or later after the linker has combined many separate compilations into a
single linkfile with the -r option, because the linker will concatenate input sections that
have the same name.
Certain procedures may be included just to identify an object file. Such a procedure is
called a VPROC ("version procedure"). The names of such procedures would always
be found in the .procinfo section of a linkfile or in the stack unwinding information of a
loadfile. Depending on whether a VPROC was visible outside its compilation, or
Finding Information About Procedures
on page A-26 for further information.
eld Manual—527255-009
A-12
User Code

Advertisement

Table of Contents
loading

Table of Contents