Cross-module optimization for dynamically-shared programs and libraries
AssigneeSilicon Graphics, Inc.
InventorsW. Wilson Ho, Sun C. Chan
Life of this patent
Estimating the term…
Abstract
A system and method of eliminating some of the indirect addressing associated with Position Independent Code (PIC). The invention applies cross-module optimization to dynamic linking of shared libraries. A definition table is built that defines where each symbol within an application program and associated shared library is defined. Also stored in the definitions table is an associated attribute. The definition table is utilized to eliminate indirect addressing wherever possible. As a result, overall system performance is increased.
Claims8
A method for generating machine-code that includes an application program and one or more shared libraries to be executed, wherein the machine-code utilizes direct and indirect addressing, comprising:
- (1) generating intermediate code from source code having two or more separate modules of code utilizing cross-module optimization, wherein said intermediate code includes information about symbol definitions in each of said separate modules of code, said intermediate code also includes information regarding the one or more libraries that will be linked at run-time;
- (2) generating a definitions table that indicates where all of said symbol definitions are defined, wherein said definitions table is incomplete since said shared library can change at run-time;
- (3) generating a machine-code object from said intermediate code by using said definitions table, wherein said machine-code object includes indirect addressing for all definitions in said definitions table that are not within said source code and direct addressing code for all definitions in said definitions table that are within said source code;
- and
- (4) linking said machine-code object with said one or more libraries.
A computer program product, comprising:
- a computer usable medium having computer readable program code means embodied in said medium for causing a computer to generate machine-code that includes an application program and one or more shared libraries to be executed, wherein the machine-code utilizes direct and indirect addressing, wherein said computer readable program code means incudes:
- computer readable program code means for causing said computer to generate intermediate code from source code having two or more separate modules of code utilizing cross-module optimization, wherein said intermediate code includes information about symbol definitions in each of said separate modules of code, said intermediate code also includes information regarding the one or more libraries that will be linked at run-time;
- computer readable program code means for causing said computer to generate a definitions table that indicates where all of said symbol definitions are defined, wherein said definitions table is incomplete since said shared library can change at run-time;
- computer readable program code means for causing said computer to generate a machine-code object from said intermediate code by using said definitions table, wherein said machine-code object includes indirect addressing for all definitions in said definitions table that are not within said source code and direct addressing code for all definitions in said definitions table that are within said source code;
- and
- computer readable program code means for causing said computer to link said machine-code object with said one or more libraries.
Dependencies are inferred from the claim text.