Reversible load-time dynamic linking
First Claim
1. A method for reversibly linking an application to a selected library and one or more external libraries, wherein the application comprises object code, the method comprising:
- archiving linking information for an application, the linking information referencing one or more external libraries for loading for the application;
selecting a library;
associating the selected library with the one or more external libraries, wherein the associating changes which libraries are to be loaded for the application, and wherein the archiving facilitates reversal of the associating; and
loading the application and the selected library.
2 Assignments
0 Petitions
Accused Products
Abstract
A library links to a compiled application using the following variation of load-time dynamic linking. At some point prior to linking, a user selects a library for linking to the compiled application. An association is made between the selected library and any external libraries referenced within the compiled application. For example, if the application is in Common Object File format, a new import table lists the selected library and the external libraries of the original import table. At link time, the selected library and the external libraries link to the compiled application. At load time, the application, selected library, and any external libraries load. When the selected library loads first, a function in the selected library performs operations before the application or external libraries load. A pointer references the list of libraries to be linked to the compiled application. The initial state of this pointer is archived. The linking process becomes reversible by restoring the initial state of the pointer and re-linking. By replacing the reference to the selected library with a reference to a second selected table, a second selected library links to the application. A data record associated with the selected library enables additional functionality of the selected library.
-
Citations
48 Claims
-
1. A method for reversibly linking an application to a selected library and one or more external libraries, wherein the application comprises object code, the method comprising:
-
archiving linking information for an application, the linking information referencing one or more external libraries for loading for the application;
selecting a library;
associating the selected library with the one or more external libraries, wherein the associating changes which libraries are to be loaded for the application, and wherein the archiving facilitates reversal of the associating; and
loading the application and the selected library. - View Dependent Claims (2, 3, 4, 5, 6, 7)
selecting an additional library while selecting the library;
associating the additional library as well as the selected library with the one or more external libraries; and
loading the additional library while loading the application and the selected library.
-
-
3. The method of claim 1 further comprising:
-
creating a data record;
storing in the data record a reference to an additional library comprising plural functions; and
during the loading, loading the additional library referenced in the data record.
-
-
4. The method of claim 3 further comprising:
storing profiling information in the data record, whereby a function of the additional library accesses the profiling information.
-
5. The method of claim 1 further comprising:
-
creating a data record; and
storing profiling information in the data record, wherein the selected library comprises plural functions, and whereby a function of the selected library accesses the profiling information.
-
-
6. The method of claim 1 wherein the selected library comprises an entry point function, and wherein the loading comprises:
-
loading the selected library;
loading one or more additional libraries using the entry point function of the selected library; and
loading the application.
-
-
7. The method of claim 1 further comprising:
loading at least one of the one or more external libraries after loading the application.
-
8. A method for reversibly linking an application to a selected library and one or more external libraries, wherein the application comprises object code, wherein a pointer references a list of libraries, wherein the pointer initially references a list of the external libraries, the method comprising:
-
archiving the state of the pointer;
selecting a library;
associating the selected library with the one or more external libraries, wherein the associating changes which libraries are linked to the application, the associating comprising;
prepending to the list of the external libraries a reference to the selected library; and
changing the state of the pointer to reference the prepended list; and
loading the application and the selected library. - View Dependent Claims (9, 10, 11)
during the loading, loading the one or more external libraries of the prepended list.
-
-
10. The method of claim 8 further comprising:
-
resetting the state of the pointer to the archived state; and
loading the application and at least one of the one or more external libraries.
-
-
11. The method of claim 8 further comprising:
-
selecting a second library;
overwriting the reference to the selected library in the prepended list with a reference to the second selected library; and
loading the application and the second selected library.
-
-
12. A method for reversibly linking an application to a selected library, wherein an executable file for the application comprises a header, a data section, and an imports section, wherein the header comprises a pointer to the imports section, wherein the data section comprises object code and one or more function calls, and wherein the imports section comprises a list of one or more names of libraries and a list for each library of the functions of the library, the method comprising:
-
creating an interim imports section;
selecting a library to link to the application;
adding to the interim imports section a reference to the selected library;
copying the imports section of the executable file;
adding to the interim imports section the copy of the imports section of the executable file after the added reference to the selected library;
changing the header pointer to reference the interim imports section, wherein the changing the header pointer changes which libraries are linked to the application; and
loading the application and at least one of the one or more libraries of the interim imports section. - View Dependent Claims (13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24)
creating an interim data section; and
storing data in the interim data section.
-
-
14. The method of claim 13 wherein the stored data comprises a reference to an additional library comprising plural functions, the method further comprising:
during the loading, loading the additional library referenced in the interim data section.
-
15. The method of claim 16 further comprising:
storing profiling information in the interim data section, whereby a function of the additional library accesses the profiling information.
-
16. The method of claim 13 wherein the stored data comprises profiling information, wherein the selected library comprises plural functions, and whereby a function of the selected library accesses the profiling information.
-
17. The method of claim 13 wherein the application comprises plural units, and wherein the stored data comprises configuration information for distributing the plural units in a distributed computing environment.
-
18. The method of claim 12 wherein the loading comprises loading the selected library before loading the application.
-
19. The method of claim 12 wherein the selected library comprises an entry point function, and wherein the loading comprises:
-
loading the selected library;
loading one or more additional libraries using the entry point function of the selected library; and
loading the application and remaining libraries of the interim imports section.
-
-
20. The method of claim 12 wherein an operating system comprises plural functions for servicing the application, wherein the selected library comprises an entry point function, and wherein the loading comprises:
-
loading the selected library;
rewriting an operating system function using the entry point function of the selected library; and
loading the application and remaining libraries of the interim imports section.
-
-
21. The method of claim 12 further comprising:
-
creating an interim header;
storing the state of the header of the executable file in the interim header, wherein the storing precedes the changing the header pointer.
-
-
22. The method of claim 21 further comprising:
-
restoring the header pointer to the state stored in the interim header; and
loading the application and at least one of the one or more libraries of the imports section of the executable file.
-
-
23. The method of claim 21 further comprising:
-
restoring the header pointer to the state stored in the interim header;
creating a second interim header;
storing the state of the header of the executable file in the second interim header;
creating a second interim imports section;
selecting a second library to link to the application;
adding a reference to the second selected library to the second interim imports section;
copying the imports section of the executable file;
adding to the second interim imports section the copy of the imports section of the executable file after the added reference to the second selected library;
changing the header pointer to reference the second interim imports section; and
loading the application and at least one of the one or more libraries of the second interim imports section.
-
-
24. The method of claim 12 further comprising:
-
selecting a second library;
overwriting the reference to the selected library in the interim imports section with a reference to the second selected library; and
loading the application and at least one of the one or more libraries of the interim imports section.
-
-
25. A computer-readable medium having stored thereon a data structure, comprising:
-
a first data field containing data representing a header for an application, the header comprising a pointer to a list of libraries linked to the application during linking;
a second data field containing data representing object code for the application and one or more references to external functions, wherein a reference to an external function is replaced with a reference to a library and function within that library during linking;
a third data field containing data representing the list of libraries and functions referenced within the object code for the application;
a fourth data field derived from the first data field, the fourth data field containing data representing an initial state of the first data field; and
a fifth data field derived from the third data field, the fifth data field containing data representing a reference to an additional library comprising plural functions, and further containing the data of the third data field, wherein the pointer of the first data field references the fifth data field to change which libraries are loaded for the application. - View Dependent Claims (26, 27, 28, 29)
a sixth data field containing data accessible only through a function of the additional library.
-
-
27. The computer-readable medium of claim 25 further comprising:
a sixth data field containing data representing references to one or more instrumentation libraries comprising plural functions, wherein a function of the additional library loads the instrumentation libraries before the loading of the application.
-
28. The computer-readable medium of claim 27 wherein the sixth data field further contains data accessible only through a function of one of the instrumentation libraries.
-
29. The computer-readable medium of claim 25 further comprising:
a sixth data field containing data representing a configuration record for distributing plural units of the application binary.
-
30. A method for reversibly linking an application to a selected library and one or more external libraries, wherein the application comprises object code, the method comprising:
-
selecting a library;
associating the selected library with the one or more external libraries;
creating a data record;
storing configuration information in the data record, wherein the application comprises plural units, and wherein the configuration information comprises a distribution scheme for the plural units in a distributed computing environment; and
loading the application and the selected library.
-
-
31. A method for reversibly linking an application to a selected library and one or more external libraries, wherein the application comprises object code, wherein an operating system comprises plural functions for servicing the application, wherein the selected library comprises an entry point function, the method comprising:
-
selecting a library;
associating the selected library with the one or more external libraries;
loading the application and the selected library, wherein the loading comprises;
loading the selected library;
rewriting an operating system function using the entry point function of the selected library; and
loading the application.
-
-
32. A computer readable medium storing computer executable instructions for causing a computer programmed thereby to perform a method of reversibly linking an application to an external library, the method comprising:
-
archiving original linking information associated with an application, the archived original linking information referencing a set of one or more external libraries for loading with the application; and
modifying the original linking information to reference the set of one or more external libraries and an additional external library, wherein the modifying causes loading of the additional external library with the application;
wherein the archiving facilitates reversal of the modifying to thereby disable the loading of the additional external library with the application. - View Dependent Claims (33, 34, 35, 36, 37, 38, 41, 42)
from the archived original linking information, restoring the original linking information; and
with the restored original linking information, loading the application without loading the additional external library.
-
-
36. The computer readable medium of claim 32 wherein the additional external library is an instrumentation library, wherein the instrumentation library is loaded before the application, and wherein the method further comprises:
profiling the application after loading the application, the instrumentation library, and the one or more external libraries.
-
37. The computer readable medium of claim 32, wherein the method further comprises:
-
from the archived original linking information, modifying the original linking information to reference the set of one or more external libraries and a second additional external library, resulting in second modified linking information; and
with the second modified linking information, loading the application with the second additional external library.
-
-
38. The computer-readable medium of claim 32 wherein the archived original linking information is stored in the application.
-
41. The utility program of claim 35 wherein the code for modifying further modifies the modified linking information to reference the set of one or more external libraries and a second additional external library, resulting in second modified linking information, thereby facilitating re-loading the application with the second additional external library.
-
42. The utility program of claim 41 wherein the second additional external library is a distribution instrumentation library.
-
39. A utility program operable to reversibly install an instrumentation package on an application, the utility program comprising:
-
code for archiving original linking information associated with the application, the archived original linking information referencing a set of one or more external libraries; and
code for modifying the original linking information to reference the set of one or more external libraries and an additional external library;
wherein the modifying causes loading of the additional external library with the application, and wherein the archiving facilitates reversal of the modifying. - View Dependent Claims (40, 43)
-
-
44. A computer-readable medium storing computer-executable instructions for causing a computer programmed thereby to perform a method of reversibly modifying a computer program the method comprising:
-
determining original state of first information in an original object file for a computer program;
modifying the first information in the original object file for the computer program, thereby creating a modified object file for the computer program; and
storing the original state of the first information in the modified object file for the computer program, the stored original state of the first information for reversing the modifying to restore the original object file the computer program. - View Dependent Claims (45, 46, 47, 48)
reversing the modifying by replacing the modified object file header with the stored original state of the object header.
-
-
48. The computer-readable medium of claim 44, wherein the method further comprises:
reversing the modifying by replacing the modified first information with the stored original state of the first information.
Specification