CPC G06F 8/47 (2013.01) [G06F 8/447 (2013.01)] | 20 Claims |
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 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 a native process executing under the native ABI; 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 one or more transformations to memory loaded from the hybrid binary image, the one or more transformations including a first 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.
|