# US 10,310,829 B2 · Compiling optimized entry points for local-use-only function pointers

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 10,310,829 B2
- Document ID: US10310829B2
- Status: Granted
- Kind: B2
- Application number: 15/417,515
- Filed: 2017-01-27
- Published: 2018-04-26
- Granted: 2019-06-04
- Earliest claimed: 2016-10-24
- Assignees: International Business Machines Corporation
- Applicants: International Business Machines Corporation
- Inventors: Michael Karl Gschwind; Ulrich Weigand
- Web page: https://patentgrep.com/patent/US10310829B2

## CPC

- G06F 8/443: {Optimisation}
- G06F 8/4441: {Reducing the execution time required by the program code}
- G06F 8/434: {Pointers; Aliasing}
- G06F 9/44521: {Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Embodiments relate to using a local entry point with an indirect call function. More specifically, an indirect call function configuration comprises a first application module having a target function of the indirect function call, a second application module with a symbolic reference to the target function of the indirect function call, and a third application module to originate an indirect function call. A compiler determines and indicates, in the program code, that the function pointer value resulting from a non-call reference of a function symbol is solely used to perform indirect calls in the same module, e.g. local-use-only. A linker or loader can read the indication the compiler made in the program code. The linker or loader use the local entry point associated with the target function if the target function is defined in the same module as the reference and is local-use-only.

## Claims

### Claim 1

A method for resolving a function address comprising:
configuring an indirect function call configuration, the configuration including defining a first application module with a target function of an indirect function call, a second application module with a symbolic reference to the target function of the indirect function call, and a third application module to originate the indirect function call;
loading a first address of a function by using a first symbolic reference;
determining that an employed value of first symbolic reference is used exclusively to perform the indirect function call in the first application module; and
indicating, in program code, that the symbolic reference can be resolved using a local entry point address of the function, wherein performing the indirect function call exclusively through the first symbolic reference resolved through a local entry point address of the function comprises reducing a quantity of operations executed through the program code.

### Claim 2 (depends on 1)

The method of claim 1, wherein the first symbolic reference can be resolved by a linker or loader.

### Claim 3 (depends on 1)

The method of claim 1, further comprising indicating the first symbolic reference can be resolved to a linker or a loader.

### Claim 4 (depends on 1)

The method of claim 1, further comprising assessing a location holding a function pointer value, including determining a full set of all references to the location is known.

### Claim 5 (depends on 4)

The method of claim 4, further comprising assessing a transitive closure of a set of locations holding the function pointer value, wherein use of the function pointer value is limited to the function call.

### Claim 6 (depends on 1)

The method of claim 1, wherein indicating that the symbolic reference can be resolved using a local entry point address of the function includes referring to a relocation record and a relocation type.

### Claim 7 (depends on 1)

The method of claim 1, further comprising:
loading a second address of the function by using a second symbolic reference;
determining that the first and second addresses are used exclusively to perform an indirect function call in the first application module;
merging the first and second symbolic references into a single symbolic reference; and
indicating that the merged symbolic reference can be resolved using a local entry point address of the function.

### Claim 8 (depends on 1)

The method of claim 1, wherein reducing a quantity of operations executed through the program code comprises improving an efficiency of the system.

### Claim 9 (depends on 8)

The method of claim 8, wherein reducing the quantity of operations executed through the program code is at least partially achieved through increasing a quantity of uses of the local entry points and reducing a quantity of uses of global entry points.

### Claim 10 (depends on 9)

The method of claim 9, wherein reducing the quantity of uses of the global entry points comprises reducing a quantity of recalculations of a value of at least one table of contents (TOC) pointer.
