Method and system for calling one of a set of routines designed for direct invocation by programs of a second type when invoked by a program of the first type
First Claim
1. A method in a computer system for calling one of a set of routines designed for direct invocation by programs of a second type when invoked by a program of a first type, comprising the steps of:
- loading the program of the first type;
when the program of the first type is loaded, loading a first library;
after loading the first library, loading a second library;
after loading the second library, reloading the first library;
when the program of the first type invokes an invoked routine of the set of routines, under the control of the first library, modifying the first library to call the invoked routine in the second library when the program of the first type invokes the invoked routine;
after modifying the first library, simulating the reinvocation of the invoked routine by the program of the first type; and
when the reinvocation of the invoked routine is simulated, calling the invoked routine in the second library under the control of the modified first library.
2 Assignments
0 Petitions
Accused Products
Abstract
A method and system for providing a set of routines that may be invoked by programs of two or more types is provided. In a preferred embodiment, a group of libraries that each are able to be called by programs of a different one of the types is provided. Each of the routines is provided by a function in one of the libraries. The method and system causes all of the libraries of the group to be loaded when any of the libraries of the group are loaded. In order to invoke a routine, a program calls a function in the library of the group that is able to be called by programs of its type. If the routine is provided by a function in this library, the library provides the routine itself. If the routine is provided by a function in another library of the group, the library calls the function that provides the routine in another library of the group. In a preferred embodiment, the library causes a calling instruction to be written into the library which calls the function that provides the routine in another library of the group in order to enable the library to call the function that provides the routine in another library of the group. In a further preferred embodiment, other libraries of the group are actually loaded only when one of their functions is called to provide a routine of the set.
89 Citations
21 Claims
-
1. A method in a computer system for calling one of a set of routines designed for direct invocation by programs of a second type when invoked by a program of a first type, comprising the steps of:
-
loading the program of the first type; when the program of the first type is loaded, loading a first library; after loading the first library, loading a second library; after loading the second library, reloading the first library; when the program of the first type invokes an invoked routine of the set of routines, under the control of the first library, modifying the first library to call the invoked routine in the second library when the program of the first type invokes the invoked routine; after modifying the first library, simulating the reinvocation of the invoked routine by the program of the first type; and when the reinvocation of the invoked routine is simulated, calling the invoked routine in the second library under the control of the modified first library. - View Dependent Claims (2, 9, 10, 12, 13)
-
-
3. A method in a computer system for calling one of a set of routines designed for direct invocation by programs of a second type when invoked by a program of a second type, comprising the steps of:
-
loading a program of the second type; when the program of the second type is loaded, loading a second library; after loading the second library, loading the first library; when the program of the second type invokes an invoked routine of the set of routines, under the control of the second library, modifying the second library to call the invoked routine in the first library when a routine of the second type invokes the invoked routine; after modifying the second library, simulating the reinvocation of the invoked routine by a program of the second type; and when the reinvocation of the invoked routine is simulated, calling the invoked routine in the first library under the control of the modified second library. - View Dependent Claims (4, 5, 6, 7)
-
-
8. A method in a computer system for calling one of a set of routines designed for direct invocation by programs of a second type when invoked by a program of a first type, comprising the steps of:
-
loading a program of the first type; when the program of the first type is loaded, loading a first library; when the program of the first type invokes an invoked routine of the set of routines, loading a second library; after loading the second library, reloading the first library; when the program of the first type invokes an invoked routine of the set of routines, under the control of the first library, modifying the first library to call the invoked routine in the second library when a routine of the first type invokes the invoked routine; after modifying the first library, simulating the reinvocation of the invoked routine by a program of the first type; and when the reinvocation of the invoked routine is simulated, calling the invoked routine in the second library under the control of the modified first library.
-
-
11. A method in a computer system for patching a segment of executable code at runtime under the control of the code segment, the code segment having a patching section and a patched section, the patching section for patching the patched section to change the contents of the patched section, comprising the steps of:
-
(a) when the code segment is executed a first time, under the control of a portion of the patched section, jumping from the beginning of the patched section to a point beyond the patched section and executing the patching section; (b) when the patching section is executed, patching the patched section, comprising the substeps of; (b)(1) patching a portion of the patched section that does not include the portion of the patched segment under the control of which step (a) is performed, and (b)(2) after step (b)(1), using a single atomic operation to patch the portion of the patched segment under the control of which step (a) is performed to instead cause the patched segment to be executed; and (c) when the code is executed after step (b), executing the patched section and preventing the patching section from being executed again.
-
-
14. A method in a computer system for pairing a first dynamic load library and a second dynamic load library, the first dynamic load library being loadable using a first loader, the second dynamic load library being loadable using a second loader, comprising the steps of:
-
(a) invoking the first loader; (b) under the control of the invoked first loader, loading the first dynamic load library and executing a first initialization routine of the first dynamic load library; (c) when the first initialization routine is executed, if no indication exists that the first loader was invoked by a second initialization routine of the second dynamic load library, invoking the second loader to load the second dynamic load library; (d) when the second loader is invoked, loading the second dynamic load library and, if the second dynamic load library has not previously been loaded, executing the second initialization routine of the second dynamic load library; and (e) when the second initialization routine is executed, invoking the first loader to load the first dynamic load library and generating an indication that the first loader was invoked by the second initialization routine. - View Dependent Claims (15, 16, 17, 18, 19, 20)
-
-
21. An article of computer-readable media having contents causing a computer system to pair a first dynamic load library and a second dynamic load library, the first dynamic load library being loadable using a first loader, the second dynamic load library being loadable using a second loader, by performing the steps of:
-
(a) invoking the first loader; (b) under the control of the invoked first loader, loading the first dynamic load library and executing a first initialization routine of the first dynamic load library; (c) when the first initialization routine is executed, if no indication exists that the first loader was invoked by a second initialization routine of the second dynamic load library, invoking the second loader to load the second dynamic load library; (d) when the second loader is invoked, loading the second dynamic load library and, if the second dynamic load library has not previously been loaded, executing the second initialization routine of the second dynamic load library; and (e) when the second initialization routine is executed, invoking the first loader to load the first dynamic load library and generating an indication that the first loader was invoked by the second initialization routine.
-
Specification