Linker using relocation sequences

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

Reexamination Certificate

active

06802060

ABSTRACT:

FIELD OF THE INVENTION
The present invention relates to a linker using relocation sequences, and particularly but not exclusively to a method of linking, a linker, a computer program product containing relocation instructions and a method of setting up a linker to implement relocation sequences.
BACKGROUND TO 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 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 module at link time in a linker.
The ELF (executable linking format) standard defines a convention for naming relocation sections belonging to a given section, e.g. reloc.abc is relocation section of section .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 that same types are reascribed to different semantics for each instruction set.
One problem which exists with existing linking techniques is that the object code module itself needs to define the necessary relocations to implement the calculations required to patch a single location for each such location in the section data in the module. For sections requiring a plurality of relocation operations, object code modules can become bloated. Moreover, it is frequently the case that the same sequence of relocation operations may be required to be implemented on different sets of section data. According to existing techniques, it is necessary to redefine the sequence of relocations in each relocation section associated with a particular set of section data.
SUMMARY OF THE INVENTION
According to one 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 sets of section data and relocation instructions, wherein said relocation instructions include a compound relocation having a type field (reltype) denoting a compound type indicator and an offset field indicating the location in the section data where the compound relocation is to be effected, the method comprising: reading the section data and relocation instructions; identifying the compound type indicator and recalling a sequence of relocations associated with said type indicator; and executing the relocation operations defined in said sequence of relocations at the said location in the section data.
Another aspect of the invention provides a method of setting up a linker to implement a sequence of relocation operations at link time at an identified location in a set of section data of an object code module, the method comprising; storing a set of relocation sequences in association with respective compound type indicators, each relocation sequence comprising a sequence of relocations defining said relocation operations.
A further aspect of the invention provides a linker for preparing an executable program from a plurality of object code modules, each module containing sets of section data and relocation instructions, wherein said relocation instructions include a compound relocation having a type field (reltype) denoting a compound type indicator and an offset field indicating the location in the section data where the compound relocation is to be effected, the linker comprising: a relocation module for reading the relocation instructions and for identifying the compound type indicator of said compound relocation; a section data module for holding section data to which the relocation instructions relate; and a store holding a plurality of sets of relocation sequences in association with respective compound type indicators, wherein the relocation module executes the relocation operations defined in said sequence of relocations identified by the compound type indicator at the said location in the 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 a compound relocation having a type field denoting a compound type indicator and an offset field indicating the location in the section data where the compound relocation is to be effected, the computer program product being cooperable with a linker to cause execution of relocation operations by the linker by recalling a sequence of relocations associated with said type indicator and executing said sequence of relocations at the identified location in the section data.
Thus, according to the following described embodiments of the invention, a mechanism is defined for defining and passing compound relocations in object files. A compound relocation is a relocation that is expanded by the linker into a sequence of relocations all at the same offset. Typically, it can be a set of non-bit relocations performing some calculation followed by a bit relocation patching the value into the section. The compound relocations allow a number of advantages to be gained.
By defining a compound relocation for frequently performed calculations to encode symbols into instructions, object file bloat can be avoided.
It is possible to achieve interoperability with non-optimising linkers by interpreting non-optimising relocation types as compound relocations. Thus, the same relocation in an object code module can have two different meanings depending on the sophistication of the linker. A standard linker can treat the relocation as a simple relocation defining a single relocation operation. A more sophisticated linker of the type described herein can interpret the relocation as a compound relocation and execute a sequence of relocations depending on the indicated type.
For a better understanding of the present invention and to show how the same may be carried into effect, reference will now be made by way of example to the accompanying drawings in which:


REFERENCES:
patent: 5613120 (1997-03-01), Palay et al.
patent: 0 962 859 (1999-12-01), None
patent: 1 085 410 (2001-03-01), None
patent: 1 085 411 (2001-03-01), None
patent: 1 085 412 (2001-03-01), None
patent: 2 358 491 (2001-07-01), None
patent: WO 94/22078 (1994-09-01), None
Cibo, D., “Macros,” 1987, EzPlus Training, pp. 1-4, http://www.ezplustraining.com/faq_mac.htm#Q1.*
Levine, R., “Linkers and Loaders,” Jun. 30, 1999, Morgan-Kaufman Publishers, Chapters: Architectural Issues, pp. 1-17; Object Files, pp. 1-28; Relocation, pp. 1-10; Shared Libraries, pp. 1-10, http://www.iecc.com/linker/linker07.html.*
Great Britain Search Report for GB Application 9925849.3, Oct. 10, 2001.
“MacOS Runtime Architectures” Apple Computer, Inc., XP-00213155 (1997); pp. 8-1-8-44.
“Tool Interface Standard (TIS) Portable Formats Specification” TIS Committee, Intel Corp., XP-002131557 (Intel Order No. 241597), Oct. 1993, v1.1, pp. 1-1-1-24.
EPO; Standard Search Report for U.K. Appl. 9925849.3; Feb. 29, 2000.

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

Linker using relocation sequences does not yet have a rating. At this time, there are no reviews or comments for this patent.

If you have personal experience with Linker using relocation sequences, we encourage you to share that experience with our LandOfFree.com community. Your opinion is very important and Linker using relocation sequences will most certainly appreciate the feedback.

Rate now

     

Profile ID: LFUS-PAI-O-3289700

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