IP Library Granted Patent US 8,418,122
Granted Patent B2
US 8,418,122 · App. 11/549,219 · Granted Apr 9, 2013

Incorporating functionality from an object file into an existing binary file

Inventors: Raj Prakash (Saratoga, CA); Chandrashekhar R. Garud (Mountain View, CA)
Assignee: Oracle America, Inc.
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 8,418,122
App. No.
11/549,219
Granted
Apr 9, 2013
Kind
B2
Abstract

Functionality from an object file can be incorporated into an already existing binary file. Functions from the object file can be intelligently inserted into the binary file with the guidance of control flow analysis of both the binary file and the object file. Symbols not defined in the symbol table of the binary file are added to the symbol table of the binary file. When symbols of the object file and the binary file overlap, then priority is given to the object file symbol definitions. The ability to incorporate functionality from an object file into an existing binary file reduces logistical overhead and provides flexibility in code development and maintenance.

Claims (41)

1. A method comprising:

examining control flow information for a binary file and an object file;

intelligently inserting code, on a processor, from the object file into the binary file, prior to run-time and in accordance with the examining, to extend or modify functionality of the binary file with functionality implemented of the code; and

updating a symbol table of the binary file, on the processor, to represent the incorporated code from the object file.

2. The method of claim 1 further comprising:

updating the binary file symbol table to include a new symbol for the code and a symbol definition for the code.

3. The method of claim 1 wherein the code is inserted either at the end of the binary file or within the binary file.

4. The method of claim 1 further comprising:

updating an entry in the binary file symbol table to represent the code from the object file, wherein the entry previously represented a code unit of the binary file being replaced with the object file code.

5. The method of claim 4 , wherein the inserting comprises one of overwriting the replaced code unit, marking the replaced code unit to be ignored, and removing the replaced code unit.

6. The method of claim 1 further comprising:

modifying a reference, in the code from the object file, to an external definition for an externally defined symbol in the code to refer to an already existing entry for the externally defined symbol in a linking table of the binary file.

7. The method of claim 1 further comprising:

modifying the code to open a path and to dynamically locate an external definition for an externally defined symbol in the opened path, the code including a reference to the externally defined symbol.

8. The method of claim 1 further comprising:

marking an externally defined symbol in the code for runtime relocation.

9. The method of claim 1 further comprising:

analyzing the binary file and building the control flow information with the analysis of the binary file.

10. The method of claim 1 , wherein the updating comprises at least one of adding a symbol from the object file symbol table to the binary file symbol table and re-defining a symbol in the binary file symbol table in accordance with the object file symbol table.

11. The method of claim 10 , wherein the re-defining comprises:

updating the binary file symbol table to indicate both an old definition already in the binary file symbol table and a new definition added from the object file symbol table for the re-defined symbol;

modifying references in the binary file to reference the new definition.

12. The method of claim 11 further comprising restoring references to the re-defined symbol to refer back to the old definition.

13. The method of claim 1 , wherein the set of symbols represents at least one of variables, data structures, functions, and data types.

14. The method of claim 1 , wherein the intelligently inserting code utilizes information from a control flow analysis of the binary file.

15. A computer program product encoded in one or more non-transitory machine-readable media, the computer program product comprising:

a first sequence of instructions executable to modify a binary file, prior to run-time, to include a symbol definition for a symbol from a symbol table of an object file, the symbol corresponding to a code unit of the object file;

a second sequence of instructions executable to modify the binary file, prior to run-time by:

examining control flow information for the binary file and the object file; and

intelligently inserting the code unit from the object file into the binary file in accordance with the examined control flow information.

16. The computer program product of claim 15 , wherein the first sequence of instructions are executable to,

search a symbol table of the binary file for the symbol,

add an entry to the symbol table of the binary file for the symbol if the symbol is not found in the symbol table, and

overwrite an existing definition in the binary file symbol table with the symbol definition from the object file if the symbol is found in the binary file symbol table.

17. The computer program product of claim 16 further comprising:

a third sequence of instructions executable to,

request indication of whether to preserve the existing definition for the symbol in the binary file symbol table as inactive, and

add the symbol definition from the object file to the binary file symbol table and modify the binary file to refer to the added symbol definition; and

a fourth sequence of instructions executable to restore the preserved inactive symbol definition.

18. The computer program product of claim 15 , wherein the second sequence of instructions are executable to modify references to the symbol to refer to location of the code unit in the binary file.

19. The computer program product of claim 15 further comprising the second sequence of instructions being executable to modify the binary file to open a path for an externally defined symbol referenced in the code unit and to dynamically locate a corresponding object file in the opened path that defines the externally defined symbol.

Assignments (2)
MERGER AND CHANGE OF NAME Recorded Dec 16, 2015
From: ORACLE USA, INC.; SUN MICROSYSTEMS, INC.; ORACLE AMERICA, INC.
To: ORACLE AMERICA, INC.
Reel/Frame 037311/0195 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Oct 13, 2006
From: PRAKASH, RAJ; GARUD, CHANDRASHEKHAR R.
To: SUN MICROSYSTEMS, INC.
Reel/Frame 018395/0965 →
Continuity (1)
Related Publication 20080092129A1 · Apr 17, 2008