HP-UX Reference (11i v3 07/02) - 4 File Formats (vol 8)
a
a.out(4) a.out(4)
16 packed decimal
17 struct/array
For procedure entry points, the parameter relocation bits define the locations of the formal parameters and
the return value. Normally, the first four words of the parameter list are passed in general registers
(r26-r23) instead of on the stack, and the return value is returned in
r29. Floating-point parameters in
this range are passed instead in floating-point registers (
fr4-fr7) and a floating-point value is returned
in
fr4. The parameter relocation bits consist of five pairs of bits that describe the first four words of the
parameter list and the return value. The leftmost pair of bits describes the first parameter word, and the
rightmost pair of bits describes the return value. The meanings of these bits are shown in the following
table.
Bits Meaning
00 No parameter or return value
01 Parameter or return value in general register
10 Parameter or return value in floating-point register
11 Double-precision floating-point value
For double-precision floating-point parameters, the odd-numbered parameter word should be marked
11
and the even-numbered parameter word should be marked
10. Double-precision return values are simply
marked
11.
Every procedure call is tagged with a similar set of bits (see "Relocation Information" below), so that the
linker can match each call with the expectations of the procedure entry point. If the call and entry point
mismatch, the linker creates a stub that relocates the parameters and return value as appropriate.
Relocation Information
Each initialized subspace defines a range of fixups that apply to the data in that subspace. A fixup request
is associated with every word that requires relocation or that contains a reference to an unsatisfied symbol.
In relocatable object files created prior to HP-UX Release 3.0 on Series 800 systems, each fixup request is a
five-word structure describing a code or data word to be patched at link time. Object files created on
Release 3.0 or later contain variable-length fixup requests that describe every byte of the subspace. The
version_id field in the file header distinguishes these two formats; the constant
VERSION_ID is found in
older object files, and the constant
NEW_VERSION_ID
is found in newer ones.
In older object files, fixups can compute an expression involving zero, one, or two symbols and a constant,
then extract a field of bits from that result and deposit those bits in any of several different formats
(corresponding to the Precision Architecture instruction set). The fixup_request_index field in the subspace
dictionary entry indexes into the fixup request area defined by the file header and the
fixup_request_quantity field refers to the number of fixup requests used for that subspace. The structure of
a fixup request is contained in
<reloc.h>.
struct fixup_request_record {
unsigned int need_data_ref: 1; /* reserved */
unsigned int arg_reloc: 10; /* parameter relocation bits */
unsigned int expression_type: 5; /* how to compute value */
unsigned int exec_level: 2; /* reserved */
unsigned int fixup_format: 6; /* how to deposit bits */
unsigned int fixup_field: 8; /* field to extract */
unsigned int subspace_offset; /* subspace offset of word */
unsigned int symbol_index_one; /* index of first symbol */
unsigned int symbol_index_two; /* index of second symbol */
int fixup_constant; /* constant */
};
/* Values for expression_type */
#define e_one 0 /* symbol1 + constant */
#define e_two 1 /* symbol1 - symbol2 + constant */
#define e_pcrel 2 /* symbol1 - pc + constant */
#define e_con 3 /* constant */
#define e_plabel 7 /* symbol1 + constant */
#define e_abs 18 /* absolute, 1st sym index is address */
/* Values for fixup_field (assembler mnemonics shown) */
#define e_fsel 0 /* F’: no change */
#define e_lssel 1 /* LS’: inverse of RS’ */
HP-UX 11i Version 3: February 2007 − 8 − Hewlett-Packard Company 27