Browse Prior Art Database

Method for creating self-aligning executables for a PIC execution mode

IP.com Disclosure Number: IPCOM000020329D
Publication Date: 2003-Nov-12
Document File: 3 page(s) / 43K

Publishing Venue

The IP.com Prior Art Database

Abstract

Disclosed is a method for creating self-aligning executables for a position independent code (PIC) execution mode. Benefits include improved functionality.

This text was extracted from a Microsoft Word document.
At least one non-text object (such as an image or picture) has been suppressed.
This is the abbreviated version, containing approximately 55% of the total text.

Method for creating self-aligning executables for a PIC execution mode

Disclosed is a method for creating self-aligning executables for a position independent code (PIC) execution mode. Benefits include improved functionality.

Description

         The disclosed method enforces alignment requirements for an executable that has been installed on a mobile device and executes in nonvolatile memory. For example, 64-bit alignment is required for using LDRD instructions for performance reasons. The operating system does not guarantee 64-bit alignment for code or data.

         The disclosed method provides a method for the executable to be self-aligning. Executables contain a header and a branch table for entry points in the module. Following this header is the implementation of the functions required to support the functionality. The entry point for the module is always at offset 0 and branches directly to the user-specified entry point. A runtime component takes control of the entry point for the module.

         This runtime component is placed directly below the module header/branch table (see Figure 1). The runtime component contains the code required to check the current alignment and relocate the rest of the program to the required alignment. Another component of this runtime is a padding area, which has been aligned on a 32-byte boundary and is contained in the code segment of the runtime (see Figure 2).

         After being invoked from the entry point, the runtime component checks the runtime location of the padding area against the alignment specified when the executable was built (such as at 32 bytes). If the alignments are not compatible, the runtime component moves the relocatable portion of the executable, using the padding area as the target to resolve the alignment differences.

         The header and the alignment runtime components are never relocated. The module information (entry point) is contained in operating system (OS) file systems/database and cannot be relocated. The executable is effectively split into a static and a relocatable segment. Successful operation relies on the system using PIC.

         If relocation is performed, the runtime component applies fix-ups to the branch table at the beginning of the module. They modify the signed offset of the branch offsets to account for the relocations performed by the runtime component.

         The runtime component stores the new relocation value in the padding area to enable reentry of the module to occur. The component uses this value to vector to the user-specified entry point, which has now been moved.

         A key feature of the disclosed method is the dynamic capability during heap compaction. The OS typi...