Forming an executable program
AssigneeSTMicroelectronics S.r.l.
InventorsRichard Shann, Stephen Clarke, Benedict Gaster, Con Bradley
Life of this patent
Estimating the term…
Abstract
A linker is described and the method of forming an executable program from object code modules using the linker. The linker uses a linker control language in the form of an ordered sequence of relaxation instructions. The relaxation instructions include a jump relaxation instruction which specifies the instruction count of the relaxation instruction which is subsequently read. In this way, more flexibility can be provided for linkers.
Claims22
A linking method for forming an executable program from a plurality of object code modules, each object code module comprising section data and an ordered sequence of relaxation instructions including a first type defining relocation operations and a second type controlling linker operations, each relaxation instruction having associated therewith a unique instruction count of a sequence of instruction counts determining the ordered sequence of relaxation instructions, wherein the second type includes a jump relaxation instruction which specifies the instruction count of a relaxation instruction to be subsequently read, the linking method comprising:
- (a) reading each relaxation instruction in the ordered sequence defined by the sequence of instruction counts;
- and
- (b) where said relaxation instruction is of the first type defining a relocation operation, executing that relocation operation on section data to which it relates, and
- where said relaxation instruction is a jump relaxation instruction, a next relaxation instruction which is read is that of the instruction count specified in the jump relaxation instruction,
- wherein the formed executable program comprises section data from the plurality of object code modules, relocated in accordance with the executed relaxation instructions.
A computer-readable medium having a computer program stored thereon to provide a linker for preparing an executable program from a plurality of object code modules, each object code module comprising section data and an ordered sequence of relaxation instructions including a first type defining relocation operations and a second type controlling linker operations, each relaxation instruction having associated therewith a unique instruction count of a sequence of instruction counts determining the ordered sequence of relaxation instructions, the linker comprising:
- a relaxation module for reading the relaxation instructions in an ordered sequence defined by the sequence of instruction counts, and for executing said relaxation instruction;
- and
- a section data module for holding section data and outputting the prepared executable program;
- wherein, when said relaxation instruction defines a relocation operation, the relaxation module executes said relocation operation on section data defined in one or more previous relaxation instructions and, when said relaxation instruction identifies section data, said section data is copied to said section data module, said section data being relocatable by subsequent previous relocation operations.
A computer program product for forming an executable program from a plurality of object code modules, said computer program product comprising program code means having section data and an ordered sequence of relaxation instructions including a first type defining relocation operations and a second type controlling linker operations, each relaxation instruction having associated therewith a unique instruction count of a sequence of instruction counts determining the ordered sequence of relaxation instruction, said program code means being arranged so that, when run on a computer, the following are performed:
- (a) reading each relaxation instruction in the ordered sequence defined by the sequence of instruction counts;
- and
- (b) where said relaxation instruction is of the first type defining a relocation operation, executing that relocation operation on section data to which it relates, and
- where said relaxation instruction is a jump relaxation instruction, a next relaxation instruction which is read is that of the instruction count specified in the jump relaxation instruction;
- wherein the formed executable program comprises section data from the plurality of object code modules, relocated in accordance with the executed relaxation instructions.
A linking method for forming an executable program from a plurality of object code modules, each object code module comprising section data and an ordered sequence of relaxation instructions including a first type defining relocation operations and a second type controlling linker operations wherein the second type includes a conditional relaxation instruction which determines whether subsequent relaxation instructions are executed depending on a condition defined in the condition relaxation instruction, the linking method comprising:
- (a) reading each relaxation instruction of the ordered sequence;
- and
- (b) where said relaxation instruction is of the first type defining a relocation operation, executing that relocation operation on section data to which it relates, and
- where said relaxation instruction is a jump relaxation instruction, a next relaxation instruction which is read is that of an instruction count specified in the jump relaxation instruction,
- and where the relaxation instruction is a conditional relaxation instruction, accessing a state variable which denotes linker state to determine whether the condition is satisfied;
- wherein the formed executable program comprises section data from the plurality of object code modules, relocated in accordance with the executed relaxation instructions.
A method of forming an executable program from a plurality of object code modules, each object code module comprising an ordered sequence of relaxation instructions including a first type defining section data, a second type defining relocation operations and a third type controlling linker operations, each relaxation instruction having associated therewith a unique instruction count of a sequence of instruction counts determining the ordered sequence of relaxation instructions, the method comprising:
- reading each relaxation instruction in the ordered sequence defined by the sequence of instruction counts;
- where said relaxation instruction defines a relocation operation, executing said relocation operation on section data defined in one or more previously read relaxation instructions;
- and
- where said relaxation instruction defines section data, copying said section data to said executable program, said section data being relocatable by subsequent previous relocation operations.
Dependencies are inferred from the claim text.