Loading and Running a Program

The loader performs the follo wing tasks:

Loads the executable module in to virtual memory locations.

Updates addresses con tained in an executable object module with the actual memory addresses.

Resolves unsatis￿ed external references to executable libraries. If an y unsatis￿ed external references remain, the loader aborts.

The loader loads executable libraries to resolv e external references b y linking the import requests of the unresolv ed reference to an export de￿nition con tained in the executable library. The actual link is made b y pointer reference to shared code. No object module in an executable library can ha ve access to the caller's data without passing parameters.

The ￿rst step in running a program is to load it. The MPE/iX Loader performs the ￿nal step in preparing a ￿le for execution in Native Mode and Compatibilit y Mode. When operating in Compatibilit y Mode, the loader sim ulates the MPE V/E Loader, with only the c hanges necessary to mak e it run.

MPE/iX Loader input consists of an executable program ￿le and an optional set of executable libraries.

The loader initializes code and data to create table en tries needed to execute or access the code and data and creates links to connect program references to executable libraries.

A program load performs the follo wing tasks:

Maps executable module in to virtual memory b y converting the code relativ e addresses to absolute addresses. (Code relativ e addresses are those whic h are relativ e to the beginning of the executable program ￿le.)

Changes the access righ ts of pages that con tain code. Code is executed without cop ying it; it is mapped to virtual memory . Write access to program code is not necessary on MPE/iX; only read and execute access is gran ted to code pages.

Creates global data areas for the program and eac h module in referenced executable libraries.

Copies global data initialization information in to process data space and sets the appropriate register to poin t to it.

Generates external reference list and attempts to locate all en tries in the list.

Program Auxiliary Header

The MPE/iX program auxiliary header resides in an executable program ￿le, is generated b y HP Link Editor/XL, and is used b y the loader. It speci￿es the follo wing information:

Primary entry point name

UNSAT procedure name

XL LIST (the list of XLs speci￿ed at link time)

Program capabilities Maximum stac k and heap sizes

Program Development 3-13