EasyManua.ls Logo

Intel i960 - Guidelines for Writing Relocatable Programs

Intel i960
347 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Position Independence and Reentrancy
9-5
9
Guidelines for Writing Relocatable Programs
A program can contain position-independent code (PIC),
position-independent data (PID), or both. Be aware of the following
restrictions:
Use position-independence only where necessary, because a program
containing position-independent code may execute more slowly than
one without.
Position-independent programs cannot be relocated during execution.
For all i960 processors, the address space is flat (unsegmented) and
byte-addressable. Addresses run contiguously from 0 to 2
32
-1. Programs
can allocate space for data, instructions, and stack anywhere within the flat
address space. However, the following restrictions apply:
Instructions must be aligned on word boundaries.
Addresses
FF000000H through FFFFFFFFH in the upper 16 megabytes
of the address space are reserved for specific functions. Check with
your system hardware designer to determine the effects of use of the
addresses in this range.
On C-series and J-series processors, the lower 1 kilobyte of address
space (addresses
0000H through 03FFH) is reserved for accessing
internal memory (RAM). On H-series processors, the lower 2 KB is
internal memory. Instruction fetch operations from this address range
are not allowed.
The
.data and .bss sections must be relocated as a unit.
Because biasing occurs during code execution, the compiler does not
support static initialization of pointers with the address of a position-
independent object. The compiler generates a warning in these cases.
For example, the following program has two pointers,
p and g, whose
initial values might not be correct when position-independence is used.
static int i;
static int *p = &i;
static int *q = 0;
static int *r = (int *) 0x7fff0000;
int f();
int (*g) () = f;

Table of Contents

Related product manuals