reloc(4) reloc(4)
NAME
reloc - relocation information for a common object file
SYNOPSIS
#include <reloc.h>
DESCRIPTION
Object files have one relocation entry for each relocatable
reference in the text or data. If relocation information is
present, it will be in the following format.
struct reloc
{
long r_vaddr ; /* (virtual) address of reference */
long r_symndx ; /* index into symbol table */
short r_type ; /* relocation type */
} ;
/*
* All generics
* reloc. already performed to symbol in the same section
*/
#define R_ABS 0
/*
* DEC Processors VAX 11/780 and VAX 11/750
*
*/
#define R_RELBYTE 017
#define R_RELWORD 020
#define R_RELLONG 021
#define R_PCRBYTE 022
#define R_PCRWORD 023
#define R_PCRLONG 024
/*
* Motorola 68000 uses R_RELBYTE, R_RELWORD, R_RELLONG,
* R_PCRBYTE, and R_PCRWORD as for DEC machines above.
*/
As the link editor reads each input section and performs
relocation, the relocation entries are read. They direct how
references found within the input section are treated.
RABS The reference is absolute, and no relocation
is necessary. The entry will be ignored.
RRELBYTE A direct 8-bit reference to a symbol's
virtual address.
Page 1 (last mod. 1/14/87)
reloc(4) reloc(4)
RRELWORD A direct 16-bit reference to a symbol's
virtual address.
RRELLONG A direct 32-bit reference to a symbol's
virtual address.
RPCRBYTE A ``PC-relative'' 8-bit reference to a
symbol's virtual address.
RPCRWORD A ``PC-relative'' 16-bit reference to a
symbol's virtual address.
RPCRLONG A ``PC-relative'' 32-bit reference to a
symbol's virtual address.
On the VAX processors, relocation of a symbol index of -1
indicates that the relative difference between the current
segment's start address and the program's load address is
added to the relocatable address.
Other relocation types will be defined as they are needed.
Relocation entries are generated automatically by the
assembler and automatically utilized by the link editor. A
link editor option exists for removing the relocation
entries from an object file.
SEE ALSO
ld(1), strip(1), a.out(4), syms(4).
Page 2 (last mod. 1/14/87)