Method and system for compiling and linking source files

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

Reexamination Certificate

active

06298479

ABSTRACT:

BACKGROUND OF THE INVENTION
1. Field of the Invention
The field of this invention relates to global register usage and conflict detection systems, methods, and computer program products, and more particularly to the indication of global register usage and the detection of usage conflicts in global registers.
2. Description of the Related Art
In particular computer program systems, registers are used to temporarily hold copies of the contents of variables required by an executing computer program. Persistent values for variables are stored in memory. It is known to be useful, moreover, to designate one or more of the registers in a computer program system as global in scope (that is, used by the entire computer program and not just by particular modules or subroutines) and to dedicate for the use of the global registers certain variables which are also of global scope.
Since particular programs are linked from individual object modules that are each compiled separately, different symbols may refer to the same global register, causing incorrect referencing and scoping of variables. Particular programs furthemore incorporate code from one or more libraries, which is also compiled separately, compounding the misreferencing. A severe technical problem arises when different portions of a particular program each use a single given global register to contain different variable values. Such a usage tends to cause incorrect results because the wrong variable value might be in the global register at the wrong time.
Additionally, another technical problem arises with respect to initializing global values during software operation. While known mechanisms exist for initializing variables in memory to given values before program execution begins, there are no such known mechanisms for initializing a register that is to contain a global variable set to a given value before execution begins.
SUMMARY OF THE INVENTION
According to the present invention, separately compiled software units expressly indicate their global register usage so that static and dynamic linkers are able to detect conflicts of usage incident to compilation. Further according to the present invention, global registers are initialized to desired values before program execution begins. According to one embodiment of the present invention, a symbol table type, STT_SPARC_REGISTER, is established to expressly indicate particular symbol table entries which associate a global symbol with a particular global register. The “name” portion of a symbol table entry points to a string that contains the name of the symbol, or else contains a NULL value to indicate that the register is used for scratch space. The “value” portion of the symbol table entry indicates the particular register to which this entry applies. Another portion of the symbol table entry indicates whether there is an initializer for the particular register. According to another embodiment of the present invention, a relocation type, R_SPARC_REGISTER, indicates an initial value for a global register.
According to the present invention, a compiler generates symbol table entries to indicate how a containing object file uses the application-reserved global registers. A static linker checks the generated symbol table entries for all object files being combined into a particular target object file to ensure that the global registers referenced by the different source elements arc used compatibly. The resulting object file produced includes these symbol table entries to indicate the resulting object global register usage. According to the present invention, the static linker warns if any shared object file that was referenced during the linking used the global registers in a fashion incompatible with the object file being built. According to the present invention, the static linker generates a warning, if a shared object file is being built that uses application-reserved global registers. A similar warning is issued according to the present invention by an archiver, if an archive library is built using application-reserved global registers. A dynamic linker according to the present invention checks to ensure that all object files being bound into a selected process have compatible uses of application-reserved global registers.
According to the present invention, a system and method for compiling and linking a source file includes a compiler for generating a symbol table which associates particular global symbols with corresponding global registers for holding variable class information pertaining to global symbols referenced or defined in the source file. The symbol table information is sufficient to enable a linker to resolve class definitions and to perform class relocation operations. The symbol table information is included in the object file generated by the compiler. The compiler particularly generates object files such that identification of usage conflicts and performance of relocation operations are delayed until operation of the linker. A linker links the object file with other object files and shared libraries to thereby generate either an executable file or a shared library. The list of other object files and shared libraries may be empty, in which case the linker generates the executable file or shared library from the single object file. The linker uses the class information contained in the object file to identify usage conflicts and to perform relocation operations.


REFERENCES:
patent: 5165038 (1992-11-01), Beard et al.
patent: 5339428 (1994-08-01), Burmeister et al.
patent: 5339431 (1994-08-01), Rupp et al.
patent: 5367651 (1994-11-01), Smith et al.
patent: 5375241 (1994-12-01), Walsh
patent: 5375242 (1994-12-01), Kumar et al.
patent: 5481708 (1996-01-01), Kukol
patent: 5564031 (1996-10-01), Amerson et al.
patent: 5613120 (1997-03-01), Palay et al.
patent: 5630157 (1997-05-01), Dwyer, III
patent: 5680622 (1997-10-01), Even
patent: 5784630 (1998-07-01), Saito et al.
patent: 5822787 (1998-10-01), Zucker
patent: 5890000 (1999-03-01), Aizikowitz et al.
patent: 6026242 (2000-02-01), Chessin et al.
Muchnick, Advanced Compiler-design Implementation, 1997, Morgan Kaufmann Publishers, Inc.

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

Method and system for compiling and linking source files does not yet have a rating. At this time, there are no reviews or comments for this patent.

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

Rate now

     

Profile ID: LFUS-PAI-O-2591412

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