Relocatable object code format and method for loading same...

Data processing: software development – installation – and managem – Software program development tool – Translation of code

Reexamination Certificate

Rate now

  [ 0.00 ] – not rated yet Voters 0   Comments 0

Details

C717S152000, C717S152000, C710S068000

Reexamination Certificate

active

06219830

ABSTRACT:

LIMITED COPYRIGHT WAIVER
A portion of the disclosure of this patent document contains material to which the claim of copyright protection is made. The copyright owner has no objection to the facsimile reproduction by any person of the patent document or the patent disclosure, as it appears in the U.S. Patent and Trademark Office file or records, but reserves all other rights whatsoever.
BACKGROUND
1. Field of the Invention
The invention relates to the loading of software into memory for execution by a computer system, and more particularly, to techniques for updating relocatable address pointers in such software to reflect the actual memory addresses at which the designated symbols are loaded.
2. Description of Related Art
Computer programs are typically written originally in source code in a computer language such as C or Pascal, or in an assembly language. To prepare the program for execution on a computer system, one or more source code modules are passed through a compiler (or assembler) which is specific to the language used and the computer system on which it will be executed, and which generates an object code file as its output. A linker routine, which is either a separate program or is part of the compiler, combines them into a single output file, known as an “executable” object code file. One or more executables are then loaded together into memory by a loader program, and control is transferred to a start address to initiate program execution.
An executable object code file typically includes, among other things, a header section which contains information about the structure of the file; one or more code sections which contains binary instructions which are directly executable by the system's CPU; one or more data sections; and a loader section, the contents of which are described below.
A data section typically contains data which was initialized by the compiler in response to the source code, descriptors describing various procedure pointers, as well as several other types of pointers. The various pointers which are contained in the data section may include some which refer to the address in memory of other data objects or of specific computer instructions. For example, a pointer may refer to specific objects in a code section, such as the entry point of a procedure. Other pointers in the data section may contain the addresses of other objects in the same data section. (As used herein, an address may be real or virtual, depending on the computer system used). Further, in systems where programs may be compiled into two or more executable files and subsequently loaded together, a data section in one file may contain pointers to objects in a code or data section of another file.
All of these references to absolute addresses must be “relocatable” since at the time of compilation and linking, the compiler/linker has no way of knowing what will be the ultimate addresses in memory at which the various referenced objects will be loaded. Thus references in an executable object code file to an address in a code section are often represented in a form which is merely relative to the start of the code section, and references to an object in a data section are represented in a form which is merely relative to the starting address of the data section. The loader program is then able to perform a relocation of these references by, after a referenced section is loaded into memory and the start address of that section is known, merely adding that start address to all of the references to objects within that section.
References to external symbols are typically represented in an executable object code file as indices into a symbol import table which is also contained in the file, each entry in the import table identifying both the name of one of the symbols and the external file which should contain that symbol. The indices are often numbered consecutively. When the loader program encounters a reference to an external symbol, it loads the external file and determines the address of the referenced symbol. The loader program then relocates the reference by adding in the address of the referenced symbol.
The loader section of an executable object code file typically includes a relocation table containing entries which specify how each relocatable reference is to be relocated upon loading into memory. For example, for a relocatable reference to an object which is within a code section, the relocation table contains a specification that the number to be added to the reference is the start address of the code section, rather than the start address of some other section. Similarly, for a relocatable reference to an object which is contained within a data section, the relocation table contains an entry specifying that the number to be added to the relocatable reference is the start address of the data section rather than of a code section. For a relocatable reference to an external symbol, the relocation table contains a corresponding specification of the index to the desired entry in the symbol import table.
When the loader program begins operation, it retrieves the desired executable object code file from a mass storage device such as a disk. If the computer system permits multiple tasks to be resident simultaneously using a shared object code section, then a separate copy of the data section(s) is (are) made for each task which will use the loaded file. In one example of memory organization, the loader may first check whether the desired file is already present in memory for another task. If not, the loader loads the header, code, data and loader sections of the file into a portion of memory which is read-only to individual users. In either case, the loader then makes a copy of the data section(s) in read/write memory for the new task.
If the loader has been invoked to load several files or modules into memory at the same time, then these files, too, are loaded into memory in the same manner as the first file. All the references to external symbols are resolved at this time, by inserting into each file's symbol import table the address into which each symbol has been loaded. Symbol imports may be resolved recursively. That is, when one module (e.g. an application program) references a symbol in a second module (e.g. a library), the loader may load and perform all relocations on the second module before returning to resolve the symbol in the first module. Similarly, if the second module references a symbol in a third module, the loader may load and perform all relocations in the third module before returning to the second, and so on.
After the various sections of file have been loaded into memory, and imports have been resolved, the loader performs the relocation process. The relocation process is performed by traversing the relocation table in the loader section, and performing the specified relocation operation for each of the relocatable references contained within the current file.
One popular format for executable object code files is known as XCOFF. XCOFF is described in the following articles published in IBM, “R6000 InfoExplorer” (CD-ROM, 1992):
“a.out File Format”,
“Optional Auxiliary Header for the a.out File”,
“Section Headers for the a.out File”,
“Raw Data Sections for the a.out File”,
“Special Data Sections for the a.out File”,
“Relocation Information for the a.out File”,
“xcoff.h”,
“filehdr.h”,
“reloc.h”,
“scnhdr.h”,
“loader.h”;
all incorporated herein by reference. In XCOFF, each entry in the relocation table is 12 bytes long and contains the following fields:
TABLE I
Length
Field Name
(Bytes)
Description
1_vaddr
4
Offset within section number
specified in 1_rsecnm, of an
information item to be
relocated.
1_symndx
4
External symbol import table
index of object that is being
referenced.
1_rtype
2
Type of relocation.
1_rsecnm
2
Number of the section
containing the relocatable item
governed by this table entry.
The l_symndx field of a relocation table entry specifies whether the item to be relocated is a reference to an external symbol, or to an object in one of t

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

Relocatable object code format and method for loading same... does not yet have a rating. At this time, there are no reviews or comments for this patent.

If you have personal experience with Relocatable object code format and method for loading same..., we encourage you to share that experience with our LandOfFree.com community. Your opinion is very important and Relocatable object code format and method for loading same... will most certainly appreciate the feedback.

Rate now

     

Profile ID: LFUS-PAI-O-2534117

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