enoft Manual
TNS/E Native Object Files
eNOFT Manual—527507-005
A-13
User Code
and .procnames sections, the DWARF sections, and the various linker-created
sections in loadfiles, are not detailed here.
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.
Text sections are allowed to contain data, such as branch tables. This should not
happen in sections that are marked for omission as in the previous paragraph.
The .procnames and .procinfo sections provide additional information about
procedures and subprocedures in linkfiles.
The size of executable code is always a multiple of 16 bytes, because instructions are
grouped into 128-bit bundles. However, even when a text section contains data, its
total size must still be a multiple of 16 bytes. (Actually, NSK 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, since the linker will concatenate input sections that
have the same name.










