Hybrid binaries supporting code stream folding

US11042422B1 · US · B1

Patent metadata
FieldValue
Publication numberUS-11042422-B1
Application numberUS-202017008346-A
CountryUS
Kind codeB1
Filing dateAug 31, 2020
Priority dateAug 31, 2020
Publication dateJun 22, 2021
Grant dateJun 22, 2021

How to read this patent

A practical reading order for non-experts. Skip the full description unless you need deep technical detail.

  1. Title

    What the patent document calls the invention.

  2. Abstract

    A short plain-language summary of the technical disclosure.

  3. Assignees and inventors

    Who owns or filed the patent and who is credited as inventor.

  4. Key dates

    Filing, priority, publication, and grant dates set the timeline.

  5. First independent claim

    The legal scope of protection — read this for what is actually claimed.

  6. CPC / IPC classifications

    Technology tags used to group this patent with similar filings.

  7. Citations and related patents

    Prior art links and similar publications in this corpus.

Abstract

Official abstract text for this publication.

A hybrid binary executable under both native processes and compatibility (e.g., emulated) processes. When the hybrid binary is loaded by a native process, the process executes a native code stream contained in the binary directly on a processor. When the hybrid binary is loaded by a compatibility process, the process executes an emulation-compatible (EC) code stream directly on a processor. When executing in a compatibility process, the EC code stream can interact with a foreign code stream that executes in an emulator. The foreign code stream can be included in the hybrid binary itself, or can be external to the hybrid binary. The hybrid binary format supports folding of code between the native code stream and the EC code stream. The hybrid binary comprises a set of memory transformations which are applied to image data obtained from the binary when the hybrid binary executes under the compatibility process.

First claim

Opening claim text (preview).

What is claimed: 1. A method, implemented at a computer system that includes a processor, for generating a hybrid binary image, the hybrid binary image being executable under both a native application binary interface (ABI) and a compatibility ABI, the method comprising: based at least on identifying a first machine type of the native ABI, emitting the first machine type into a machine type field of the hybrid binary image, the machine type field being structured to be utilized when the hybrid binary image is loaded by a native process executing under the native ABI; based at least on identifying a first function that is non-foldable, emitting, into the hybrid binary image, both of (i) a first compiled version of the first function that is executable under the native ABI, and (ii) a second compiled version of the first function that is executable under the compatibility ABI; based at least on identifying a second function that is foldable, emitting into the hybrid binary image a compiled version of the second function that is executable under both of the native ABI and the compatibility ABI, the compiled version of the second function being structured to call the first compiled version of the first function when the hybrid binary image is loaded by the native process; and emitting, into the hybrid binary image, a fixup table that is structured to be utilized when the hybrid binary image is loaded by a compatibility process executing under the compatibility ABI, the fixup table defining a plurality of transformations to memory data loaded from the hybrid binary image, the plurality of transformations including: a first transformation that adjusts the machine type field to comprise a second machine type of the compatibility ABI; and a second transformation that configures the compiled version of the second function to call the second compiled version of the first function instead of the first compiled version of the first function. 2. The method of claim 1 , further comprising: emitting, into the hybrid binary image, one or more tables that comprise (i) a first zone referencing at least the first function using the first compiled version of the first function, (ii) a second zone referencing at least the second function using the compiled version of the second function, and (iii) a third zone referencing at least the first function using the second compiled version of the first function; and emitting, into the hybrid binary image, a reference to the one or more tables that provides a native view of the one or more tables that includes the first zone and the second zone, while excluding the third zone, the reference being structured to be utilized when the hybrid binary image is loaded by the native process, wherein the plurality of transformations also include a third transformation that adjusts the reference to the one or more tables to provide a compatibility view of the one or more tables that includes the second zone and the third zone, while excluding the first zone. 3. The method of claim 2 , wherein, the one or more tables comprise one or more import tables, and the first, second, and third zones comprise first, second, and third function imports; or the one or more tables comprise one or more export tables, and the first, second, and third zones comprise first, second, and third function exports. 4. The method of claim 2 , wherein the reference to the one or more tables provides the native view of the one or more tables by specifying an offset and a size, and wherein the third transformation adjusts the reference to provide the compatibility view by modifying one or more of the offset or the size. 5. The method of claim 1 , further comprising emitting, into the hybrid binary image, an entry point referencing the first compiled version of the first function, the entry point being structured to be utilized when the hybrid binary image is loaded by the native process. 6. The method of claim 5 , wherein the plurality of transformations also include a third transformation that adjusts the entry point to reference the second compiled version of the first function. 7. The method of claim 1 , wherein the compiled version of the second function is structured to call the first compiled version of the first function via a dispatch table that references the first compiled version of the first function, and wherein the second transformation modifies the dispatch table to reference the second compiled version of the first function instead of the first compiled version of the first function. 8. The method of claim 7 , further comprising emitting the dispatch table into the hybrid binary image. 9. A computer system for generating a hybrid binary image, the hybrid binary image being executable under both a native application binary interface (ABI) and a compatibility ABI, comprising: a processor; and a hardware storage device that stores computer-executable instructions that are executable by the processor to cause the computer system to perform at least the following: based at least on identifying a first machine type of the native ABI, emit the first machine type into a machine type field of the hybrid binary image, the machine type field being structured to be utilized when the hybrid binary image is loaded by a native process executing under the native ABI; based at least on identifying a first function that is non-foldable, emit, into the hybrid binary image, both of (i) a first compiled version of the first function that is executable under the native ABI, and (ii) a second compiled version of the first function that is executable under the compatibility ABI; based at least on identifying a second function that is foldable, emit into the hybrid binary image a compiled version of the second function that is executable under both of the native ABI and the compatibility ABI, the compiled version of the second function being structured to call the first compiled version of the first function when the hybrid binary image is loaded by the native process; and emit, into the hybrid binary image, a fixup table that is structured to be utilized when the hybrid binary image is loaded by a compatibility process executing under the compatibility ABI, the fixup table defining a plurality of transformations to memory data loaded from the hybrid binary image, the plurality of transformations including: a first transformation that adjusts the machine type field to comprise a second machine type of the compatibility ABI; and a second transformation that configures the compiled version of the second function to call the second compiled version of the first function instead of the first compiled version of the first function. 10. The computer system of claim 9 , the computer-executable instructions also executable by the processor to cause the computer system to: emit, into the hybrid binary image, one or more tables that comprise (i) a first zone referencing at least the first function using the first compiled version of the first function, (ii) a second zone referencing at least the second function using the compiled version of the second function, and (iii) a third zone referencing at least the first function using the second compiled version of the first function; and emit, into the hybrid binary image, a reference to the one or more tables that provides a native view of the one or more tables that includes the first zone and the second zone, while excluding the third zone, the reference being structured to be utilized when the hybrid binary image is loaded by the native process, wherein the plurality of transformations also include a third transformation that adjusts the reference to the one or more tables to provide a co

Assignees

Inventors

Classifications

  • G06F9/541Primary

    via adapters, e.g. between incompatible applications · CPC title

  • Fat binaries · CPC title

  • Version control (security arrangements therefor G06F21/57); Configuration management · CPC title

  • G06F8/447Primary

    Target code generation · CPC title

  • Reducing the memory space required by the program code · CPC title

Patent family

Related publications grouped by family.

External sources

Frequently asked questions

Answers are generated from the same data shown on this page.

What does patent US11042422B1 cover?
A hybrid binary executable under both native processes and compatibility (e.g., emulated) processes. When the hybrid binary is loaded by a native process, the process executes a native code stream contained in the binary directly on a processor. When the hybrid binary is loaded by a compatibility process, the process executes an emulation-compatible (EC) code stream directly on a processor. Whe…
Who is the assignee on this patent?
Microsoft Technology Licensing Llc
What technology area does this patent fall under?
Primary CPC classification G06F9/541. Mapped technology areas include Physics.
When was this patent published?
Publication date Tue Jun 22 2021 00:00:00 GMT+0000 (Coordinated Universal Time) (B1). Legal status and post-grant events are not shown on this page.
What related patents are in patentsdb?
We list 5 related publications on this page (citations in our corpus or others sharing the same primary CPC).