Relocation format for linking

Data processing: software development – installation – and managem – Software program development tool – Linking

Reexamination Certificate

Rate now

  [ 0.00 ] – not rated yet Voters 0   Comments 0

Details

C717S153000, C717S139000, C717S140000, C709S241000, C712S221000, C712S223000

Reexamination Certificate

active

06687899

ABSTRACT:

FIELD OF THE INVENTION
The present invention relates to a relocation format for linking, and in particular to a method of linking, a linker and a computer program product containing relocation instructions.
BACKGROUND OF THE INVENTION
Linkers for producing executable programs are known. Generally speaking, a linker acts to link a number of object code modules to form a single executable program. Object code modules are usually generated from program source code modules, these modules being written in a high level language. An assembler/compiler reads each source code module and assembles and/or compiles the high level language of the source code module to produce an object code module. The assembler also generates a number of relocations which are used to combine the object code modules at link time in a linker.
The ELF (executable linking format) standard defines a convention for naming relocations belonging to a given section, e.g. rela.abc is relocation section of section space .abc. Standard relocations under the ELF format allow an offset in section data to be defined where patching is to occur and a symbol whose value is to be patched. A type field also exists which is used to describe the appropriate method of encoding the value of the symbol into the instruction or data of the section data being patched. According to the existing arrangements, the relocation type definitions are usually created on an ad hoc basis for each instruction set targeted. The 32 bit ELF standard allows only 256 distinct relocation types, so the same types are reascribed to different semantics for each instruction set.
The existing linkers each have to be set up to understand the particular semantics used for the type definitions in the relocations for each instruction set. Moreover, the relocation operations which can be defined by the relocations are limited in the existing ELF standard.
It is an object of the invention to provide novel relocations which extend the possibilities of the linker at link time, and which allow for more complex evaluations to be carried out at link time.
SUMMARY OF THE INVENTION
According to an aspect of the present invention there is provided a method of preparing an executable program from a plurality of object code modules, each module containing section data and relocation instructions, wherein the relocation instructions include special relocations which each include a type field identifying the nature of the function to be implemented by the special relocation, said function being selected from a plurality of arithmetic and logical functions, the method comprising: reading the section data and relocation instructions; determining from the type field of a special relocation the nature of the function to be implemented; and carrying out said selected arithmetic or logical function to generate a result value; and using said result value in a subsequent relocation operation defined by another of the relocation instructions.
Another aspect of, the invention provides a linker for preparing an executable program from a plurality of object code modules, each module containing section data and relocation instructions wherein the relocation instructions include special relocations which each include a type field identifying the nature of the function to be implemented by the special relocation, said function being selected from a plurality of arithmetic and logical functions, the linker comprising: a relocation module for reading said relocation instructions and carrying out relocation operations on the section data, including determining from the type field of a special relocation the nature of the function to be implemented; said relocation module comprising means for implementing calculations conveyed by the relocation instruction; a link store for holding a result value generated by carrying out said selected arithmetic or logical functions; and a program forming module for preparing the executable program using the relocated section data.
A further aspect of the invention provides a computer program product in the form of an object code module which contains sets of section data and relocation instructions, wherein the relocation instructions include special relocations which each include a type field identifying the nature of the function to be implemented by the special relocation, said function being selected from a plurality of arithmetic and logical functions, the computer program product being cooperable with the linker to cause execution of relocation operations by the linker so as to carry out said selected arithmetic or logical functions to generate a result value for use in subsequent relocation operations defined by others of the relocation instructions.
The special relocation can include at least one argument field for specifying a value to be used in the function identified in the type field. The special relocations can include a push operation which cause the value identified in the argument field to be placed in a store for subsequent use in an arithmetic or logical function of another special relocation. The use of a stack as a store is particularly useful, because values are pushed onto the top of the stack and retrieved from the top of the stack. It allows ordered semantics of the relocations to be made.
The argument field can convey the value which is to be used in the arithmetic or logical function conveyed by the same relocation.
The argument field can hold a symbol with points to a value in a symbol table, said value to be used in a subsequent arithmetic or logical function.
The result of the function can be used as a condition value to determine a condition which establishes which of a plurality of code sequences in the object module is to be included in an executable program.
The type field can hold an index for accessing a condition array which holds values in association with said indices, said values having been determined by earlier arithmetic or logical functions conveyed by relocations and being usable to establish conditions.
The special relocations can include a store relocation instruction which supplies the index and causes that top of stack value to be held in the condition array for subsequent use at the index. A further special relocation which can be provided is a fetch relocation instruction which allows the value to be recalled from the condition array and pushed onto the top of the stack, the index being supplied with the fetch relocation instruction.
The linker can include a section data module for holding section data to which the relocation instructions relate. Moreover, it can include a condition evaluator for examining a value (typically the top of the stack) at link time to determine whether or not a condition conveyed by the relocation instruction is satisfied. On this basis the relocation module is operable to instruct a section data module to conditionally include sequences of the section data in the executable program based on the evaluated condition.
A linker can have a parameter array for holding a set of parameters each associated with a respective index, the parameters identifying code sequences for possible inclusion in the executable program. Alternatively or additionally, the linker can have a symbol table which holds values in association with symbols, said symbols being conveyed by the relocation instructions. Alternatively and/or additionally, the linker can have a condition array which holds a plurality of values in association with respective indexes, said indexes being conveyed by the relocation instructions for recall of one of said plurality of values for use in determining a condition.


REFERENCES:
patent: 5193180 (1993-03-01), Hastings
patent: 5317704 (1994-05-01), Izawa et al.
patent: 5355475 (1994-10-01), Tanaka et al.
patent: 5835701 (1998-11-01), Hastings
patent: 6021408 (2000-02-01), Ledain et al.
patent: 6049781 (2000-04-01), Forrest et al.
patent: 6112025 (2000-08-01), Mulchandani et al.
patent: 6206584 (2001-03-01), Hastings
patent: 6219830 (2001-04-01), Eidt et al.
patent: 6298479 (2001

LandOfFree

Say what you really think

Search LandOfFree.com for the USA inventors and patents. Rate them and share your experience with other people.

Rating

Relocation format for linking does not yet have a rating. At this time, there are no reviews or comments for this patent.

If you have personal experience with Relocation format for linking, we encourage you to share that experience with our LandOfFree.com community. Your opinion is very important and Relocation format for linking will most certainly appreciate the feedback.

Rate now

     

Profile ID: LFUS-PAI-O-3333040

  Search
All data on this website is collected from public sources. Our data reflects the most accurate information available at the time of publication.