IP Library › Granted Patent US 9,384,130
Granted Patent B2
US 9,384,130 · App. 14/570,000 · Granted Jul 5, 2016

Rewriting symbol address initialization sequences

Inventors: Michael Karl Gschwind (Chappaqua, NY); Ulrich Weigand (Holzgerlingen, DE)
Assignee: International Business Machines Corporation
G06F12/0646G06F2212/1016G06F2212/1032
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 9,384,130
App. No.
14/570,000
Granted
Jul 5, 2016
Kind
B2
Abstract

A system includes a memory to store a linker and one or modules, and a processor, communicatively coupled to the memory. The computer system is configured to recognize a first symbol address initialization sequence in a module. The system determines whether the first symbol address initialization sequence is a candidate for replacement, determines whether to replace the first symbol address initialization sequence with a second symbol address initialization sequence, and replaces the first symbol address initialization sequence with the second symbol address instruction sequence when it is determined to replace the first symbol address initialization sequence with the second symbol address initialization sequence.

Claims (21)

1. A computer-implemented method for linking object code comprising:

recognizing a first symbol address initialization sequence in a module by determining that first symbol address initialization sequence corresponds with a pre-defined symbol address instruction sequence, wherein the first symbol address initialization sequence includes one or more instructions for loading an address in a first register of a processor, the one or more instructions including an instruction that depends on a value stored in a second register of the processor, the first register for storing an address of a table of contents (TOC) and the second register for storing a starting address of the module;

determining whether to replace the first symbol address initialization sequence with a second symbol address initialization sequence by determining whether a first condition is satisfied, wherein the first condition is that the second symbol address initialization sequence has a second processor resource usage that is less than a first processor resource usage associated with the first symbol address initialization sequence; and

replacing the first symbol address initialization sequence with the second symbol address instruction sequence when it is determined that the first condition is satisfied.

2. The method of claim 1 , wherein the first symbol address initialization sequence is position independent code.

3. The method of claim 1 , further comprising generating a procedure linkage table (PLT) stub for a function that calls the module, the PLT stub including an instruction to load the starting address of the module in the second register.

4. The method of claim 1 , wherein the recognizing of the first symbol address initialization sequence in the module includes determining that the first symbol address initialization sequence is at a beginning of a function having at least a global function entry point and a local function entry point, wherein the global entry point is an entry point of a function call when the function call is a direct and external function call or an indirect function call, and wherein the local entry point is an entry point of a function call when the function call is a direct and local function call or a call not requiring a TOC pointer value.

5. The method of claim 4 , the first condition includes that the first symbol address initialization sequence between the global and local function entry point cannot be branched into.

6. The method of claim 1 , wherein the module includes position independent code (PIC), the first symbol address initialization sequence is configured for use with position independent code (PIC), and the second symbol address initialization sequence is configured for use with position dependent code (PDC).

7. The method of claim 6 , wherein the first condition is that an address of the TOC pointer of the module is within a first or last 2 GB of a 64-bit address space.

8. The method of claim 1 , wherein the module includes position dependent code (PDC), the first symbol address initialization sequence is configured for use with position dependent code (PDC), and the second symbol address initialization sequence is configured for use with position dependent code (PDC).

9. The method of claim 8 , wherein the first condition includes that the first symbol address initialization sequence is configured to load a 64-bit address and that an address of the TOC pointer of the module is within a first or last 2 GB of a 64-bit address space.

10. The method of claim 1 , wherein the first condition includes that one of relocation information or a linker switch indicates that no branches are allowed to target an address between a first and second entry point.

11. The method of claim 1 , further comprising:

determining whether the first symbol address initialization sequence has a different number of instructions than the second symbol address initialization sequence; and

updating at least one function entry address when the first symbol address initialization sequence has a different number of instructions than the second symbol address initialization sequence.

12. The method of claim 1 , wherein the second symbol address initialization sequence includes one or more instructions for loading an address in the first register, the one or more instructions including an instruction that includes a symbol defined by a linker that refers to the address of the TOC.

13. A computer-implemented method for linking object code comprising:

recognizing a first symbol address initialization sequence in a module by determining that first symbol address initialization sequence corresponds with a pre-defined symbol address instruction sequence, wherein the first symbol address initialization sequence includes one or more instructions for loading an address in a first register of a processor, the one or more instructions including an instruction that depends on a value stored in a second register of the processor, the first register for storing an address of a table of contents (TOC) and the second register for storing a starting address of the module;

determining whether to replace the first symbol address initialization sequence with a second symbol address initialization sequence by determining whether a first condition is satisfied, wherein the first condition is that one of relocation information or a linker switch indicates that no branches are allowed to target an address between a first and second entry point; and

replacing the first symbol address initialization sequence with the second symbol address instruction sequence when it is determined that the first condition is satisfied.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Dec 15, 2014
From: GSCHWIND, MICHAEL KARL; WEIGAND, ULRICH
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 034505/0214 →
Continuity (2)
Continuation 14527819 · Oct 30, 2014
Related Publication 20160124850A1 · May 5, 2016