Position-Independent Code and Data

For position-independent code (PIC) and position-independent data (PID), your LCF must include .picdynrel and .piddynrel sections. These sections specify where to store the PIC and PID dynamic relocation tables.

In addition, your LCF must define these six symbols:

__START_PICTABLE __END_PICTABLE__PICTABLE_SIZE__START_PIDTABLE__END_PIDTABLE __PIDTABLE_SIZE

The following listing is an example definition for PIC and PID.

Listing: PIC, PID Section Definition

.pictables :

{

. = ALIGN(0x8);

__START_PICTABLE = .;

*(.picdynrel)__END_PICTABLE = .;

__PICTABLE_SIZE = __END_PICTABLE - __START_PICTABLE;

__START_PIDTABLE = .;

*(.piddynrel)__END_PIDTABLE = .;

__PIDTABLE_SIZE = __END_PIDTABLE - __START_PIDTABLE;

} >> DATA