Dual-Architecture Function Pointers with Consistent ABI Reference Addresses
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing solutions for executing foreign software on computing devices face performance penalties and inefficiencies due to emulation, and the distribution of fat binaries leads to storage issues and user confusion, while current interoperability methods fail to enable seamless native execution.
Innovation Solution
The development of an Emulation Compatible (EC) Application Binary Interface (ABI) that facilitates native execution of applications by mirroring foreign ABIs, allowing for context and calling conventions compatible with both native and foreign code, enabling consistent memory address references and efficient interoperability through hybrid binaries.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If software-based ISA emulation is used to execute foreign software, then foreign software can be executed on devices with different ISAs, but significant performance penalties are incurred
Solution Approach 1:
The patent segments the binary into separate code streams for different ABIs (e.g., AArch64 and x86-64) and uses an import table to map function calls to the appropriate code stream based on the target ABI, enabling native execution without full emulation
Solution Approach 2:
The patent introduces an import table as an intermediary structure that sits between the calling code and the actual function implementations, allowing the system to resolve function calls to the correct ABI-specific implementations without requiring the calling code to be aware of the target ABI
2Adaptability or versatility
If fat binaries including both native and foreign code streams are distributed, then a single binary can support multiple ABIs, but the binary size doubles consuming precious storage resources
Solution Approach 1:
The patent merges multiple ABI-specific code streams into a single hybrid binary file, using an import table to organize and manage the different code streams, allowing the binary to support multiple ABIs while maintaining a unified structure
Solution Approach 2:
The import table serves as a universal structure that can resolve function calls for multiple different ABIs (AArch64, x86-64, and future ABIs) through a single mechanism, making the binary universally compatible across different architectures
3Adaptability or versatility
If fat binaries with multiple code streams are distributed, then multi-ABI compatibility is achieved, but user confusion and frustration increase due to lack of awareness about ISAs and ABIs
Solution Approach 1:
The system performs self-service by automatically detecting the target ABI and resolving function calls to the appropriate code stream through the import table, eliminating the need for users to manually select or understand ABI compatibility
4Productivity
If separate binaries for different ABIs are distributed, then each binary can execute natively, but distribution and support burden increases for developers
Solution Approach 1:
The patent combines multiple ABI-specific implementations into a single hybrid binary file with an import table that manages the different code streams, reducing distribution complexity while maintaining native execution capability for each ABI
Data Source
Figure 1
Figure 2
Figure 3A
AI summary
Using a common reference address when processing calls among a native ABI and a foreign ABI. Based on caller calling using a reference address, a lookup structure is used to determine whether the reference address is within a memory range storing native code (and that the callee is native) or a memory range not storing native code (and that the callee is foreign). Execution of the callee is initiated based on one of (i) when the caller is native and when the callee is foreign, calling the callee using the reference address within an emulator; (ii) when the caller is foreign and the callee is native, calling an entry thunk; (iii) when the caller is native and the callee is foreign, calling an exit thunk; or (iv) when the caller is native and the callee is native, directly calling the callee using the reference address.