Subsections

3. The DXELOAD unit

3.1 Introduction

The dxeload unit was implemented by Pierre Müller for DOS, it allows to load a DXE file (an object file with 1 entry point) into memory and return a pointer to the entry point.

It exists only for DOS.

3.2 Constants, types and variables

3.2.1 Constants

The following constant is the magic number, found in the header of a DXE file.
DXE_MAGIC  = $31455844;

3.2.2 Types

The following record describes the header of a DXE file. It is used to determine the magic number of the DXE file and number of relocations that must be done when the object file i sloaded in memory.
dxe_header = record
   magic,
   symbol_offset,
   element_size,
   nrelocs       : longint;
end;

3.3 Functions and Procedures


3.3.1 dxe_load

Declaration
function dxe_load(filename : string) : pointer;
Description
dxe_load loads the contents of the file filename into memory. It performs the necessary relocations in the object code, and returns then a pointer to the entry point of the code.
Errors
If an error occurs during the load or relocations, Nil is returned.
For an example, see the emu387 unit in the RTL.

root
2000-12-20