# US 2019/0171426 A1 · Program compiler and linker, and method

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

- Number: US 2019/0171426 A1
- Document ID: US20190171426A1
- Status: Published application
- Kind: A1
- Application number: 16/309,972
- Filed: 2017-05-31
- Published: 2019-06-06
- Earliest claimed: 2016-07-21
- Assignees: Sony Interactive Entertainment Inc.
- Applicants: Sony Interactive Entertainment Inc.
- Inventors: Paul Bowen-Hugget
- Web page: https://patentgrep.com/patent/US20190171426A1

## CPC

- G06F 8/48: {Incremental compilation (software reuse G06F8/36)}
- G06F 8/4443: {Inlining}
- G06F 8/54: Link editing before load time
- G06F 8/71: Version control (security arrangements therefor G06F21/57); Configuration management
- G06F 11/3624: {by performing operations on the source code, e.g. via a compiler}
- H04L 9/0643: {Hash functions, e.g. MD5, SHA, HMAC or f9 MAC}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)

## Abstract

Methods and apparatus include: obtaining a source code element from source code, obtaining compiler options for compilation of the source code element, applying a hash function to data representing the source code element and compiler options to generate a first hash value specific to the combination of the source code element and compiler options, and searching a repository for the first hash value. If the first hash value is not found in the repository, generating an object code fragment from the source code element using the compiler options, and storing the generated object code fragment and first hash value in association with each other in the repository. If the first hash value is found in the repository, not generating an object code fragment from the source code element; generating a list identifying one or more object code fragments in the repository that when suitably combined form object code for the source code, receiving at a linker data identifying one or more object code fragments, the object code fragments each corresponding to a source code element compiled according to respective compiler options, accessing the or each identified object code fragment from a repository of object code fragments, and commencing a memory layout mapping of object code fragments to addresses.

## Claims

### Claim 1

A method of compiling and linking, comprising the steps of:
obtaining at a compiler a source code element from source code;
obtaining compiler options for compilation of the source code element;
applying a hash function to data representing the source code element and compiler options, to generate a first hash value specific to the combination of the source code element and compiler options;
searching a repository for the first hash value;
if the first hash value is not found in the repository,
generating an object code fragment from the source code element using the compiler options; and
storing the generated object code fragment and first hash value in association with each other in the repository; whereas
if the first hash value is found in the repository,
not generating an object code fragment from the source code element;
generating a list identifying one or more object code fragments in the repository that when suitably combined form object code for the source code;
receiving at a linker data identifying one or more object code fragments, the object code fragments each corresponding to a source code element compiled according to respective compiler options;
accessing the or each identified object code fragment from a repository of object code fragments; and
commencing a memory layout mapping of object code fragments to addresses.

### Claim 2 (depends on 1)

The method of claim 1, wherein the data representing the source code element comprises an intermediate representation of the source code.

### Claim 3 (depends on 1)

The method of claim 1, wherein the data representing the compiler options incorporates inlining decisions made by the compiler.

### Claim 4 (depends on 1)

The method of claim 1, comprising repeating the steps for any additional source code elements in the source code.

### Claim 5 (depends on 1)

The method of claim 1, wherein the generated list is stored in the repository in association with a unique ID, and the unique ID is output for use by a linker.

### Claim 6 (depends on 1)

The method of claim 1, in which the linker uses available correspondences between a graph representation of the program and the object code fragments to detect connections between fragments, instead of performing a scan function of those object code fragments.

### Claim 7 (depends on 6)

The method of claim 6 in which the linker only duplicates into a working space those sections of object code fragments used in a final executable image.

### Claim 8 (depends on 1)

The method of claim 1, in which a generated executable comprises one or more links corresponding to one or more object code fragments in the repository of object code fragments, and the method comprises the step of: loading debugging metadata directly from the one or more object code fragments in the repository of object code fragments, by a debugger.

### Claim 9

A non-transitory, computer readable storage medium containing computer executable instructions adapted to cause a computer system to perform actions, comprising:
obtaining at a compiler a source code element from source code;
obtaining compiler options for compilation of the source code element;
applying a hash function to data representing the source code element and compiler options, to generate a first hash value specific to the combination of the source code element and compiler options;
searching a repository for the first hash value;
if the first hash value is not found in the repository,
generating an object code fragment from the source code element using the compiler options; and
storing the generated object code fragment and first hash value in association with each other in the repository; whereas
if the first hash value is found in the repository,
not generating an object code fragment from the source code element;
generating a list identifying one or more object code fragments in the repository that when suitably combined form object code for the source code;
receiving at a linker data identifying one or more object code fragments, the object code fragments each corresponding to a source code element compiled according to respective compiler options;
accessing the or each identified object code fragment from a repository of object code fragments; and
commencing a memory layout mapping of object code fragments to addresses.

### Claim 10

A compiler and linker, comprising
an obtaining processor arranged to obtain a source code element from source code;
an obtaining processor arranged to obtain compiler options for compilation of the source code element;
a hashing processor arranged to apply a hash function to data representing the source code element and compiler options, thereby generating a first hash value specific to the combination of the source code element and compiler options;
a memory arranged to store a repository;
a search processor arranged to search the repository for the first hash value;
and if the first hash value is not found in the repository,
a generating processor is arranged to generate an object code fragment from source code element using the compiler options, and
the generating processor is arranged to store the generated object code fragment and first hash value in association with each other in the repository;
but if the first hash value is found in the repository,
the generating processor is arranged to not generate an object code fragment from source code element;
a list processor arranged to generate a list identifying one or more object code fragments in the repository that when suitably combined form object code for the source code;
an obtaining processor arranged to obtain the list identifying one or more object code fragments, the object code fragments each corresponding to a source code element compiled according to respective compiler options;
an accessing processor arranged to access the or each identified object code fragment from a repository of object code fragments; and
a layout processor arranged to perform memory layout mapping of object code fragments to addresses.
