Method and apparatus for dynamically linking subprogram to main program using tabled procedure name comparison
AssigneeHewlett-Packard Company
InventorsMichael L. Hall, Glenn R. Engel
Life of this patent
Estimating the term…
Abstract
A dynamic linker links a subprogram into an already complete program while the program is running. The linking is performed by initially creating a procedure in the subprogram with a name that matches a present procedure name within the program. The dynamic linker then compares the names to find the present procedure and replaces it with the subprogram procedure. The subprogram may contain one or more procedures that include additional functions. Procedure replacement techniques are described for RAM-and ROW-based systems. Unlike conventional linkers, the linking occurs while the program continues to run, preserving the program's data and state while changing or augmenting its functions.
Claims7
A computer implemented method of dynamically linking a subprogram that includes a replacement procedure to a main program while the main program is running, comprising the computer implemented steps of:
- comparing within the computer the procedure name in a subprogram symbol table with main program procedure names in a main program symbol table to locate a main program procedure that matches the subprogram name;
- and
- changing an instruction in the main program to cause the named main program procedure having the matching name to a jump instruction to cause a jump to the subprogram procedure whenever the main program procedure is called.
Apparatus for dynamically linking in a computer a subprogram to a main program while the main program is running, comprising:
- means for comparing procedure names in a subprogram symbol table with procedure names in a main program symbol table to determine if a duplicate name appears in both tables;
- and
- modifying means responsive to a determination of duplicative names for changing an instruction in the main program procedure having the duplicate name to a jump instruction to cause a jump to the subprogram procedure whenever the main program procedure is called.
A method of dynamically linking a subprogram to a currently executing main program, comprising:
- providing a subprogram procedure with a name matching the name of a main program procedure;
- translating the subprogram procedure to place the name of the subprogram procedure in a subprogram symbol table;
- comparing the subprogram procedure name in the subprogram symbol table with main program procedure names in a main program symbol table for locating the main program procedure having the matching name;
- providing an entry point to the main program procedure in a writable memory location that contains the address of the main program procedure;
- and
- writing the address of the subprogram procedure into the memory location over the address of the main program procedure.
A computer implemented method of dynamically linking a subprogram to a currently executing main program, comprising the computer implemented steps of:
- providing a subprogram procedure with a name matching the name of a min program procedure;
- translating the subprogram procedure to place the name of the subprogram procedure in a subprogram symbol table;
- comparing the subprogram procedure name in the subprogram symbol table with main program procedure names in a main program symbol table for locating the main program procedure having the matching name;
- and
- changing an instruction in the main program procedure having the matching name to a jump instruction to cause a jump to the subprogram procedure whenever the main program procedure is called.
Dependencies are inferred from the claim text.