Executable

and interactions with the operating system, notably passing arguments, environment, and returning an exit status, together with other startup and shutdown features such as releasing resources like file handles.

For C, this is done by linking in the crt0 object, which contains the actual entry point and does setup and shutdown by calling the runtime library.

In some cases, it is desirable to omit this, for example for embedded systems development, or simply to understand how compilation, linking, and loading work.

In C, this can be done by omitting the usual runtime, and instead explicitly specifying a linker script, which generates the entry point and handles startup and shutdown, such as calling main to start and returning exit status to the kernel at the end.

For example, in ELF, the entry point is defined in the header's e_entry field, which specifies the (virtual) memory address at which to start execution.

A hex dump of an executable real mode loader. The first column consists of addresses of the first byte in the second column, which comprises bytes of data in hexadecimal notation ( least significant byte first), and the last column consists of the corresponding ASCII form. [ 1 ]