Register Address Mapping for Mixed-Bit Library Cross-Linking
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current compiling-linking processes face challenges in cross-linking programs with different numbers of address bits, requiring workers to upgrade all library functions to a higher bit number, leading to significant workload and hindering development.
Innovation Solution
A cross-linking method that modifies register addresses in library function instructions using a mapping table to align bit numbers, allowing migration to a main program without upgrading all compilers, and includes renaming and scanning operations to ensure correctness and efficiency.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If all library functions are upgraded to the first address bit number, then cross-linking correctness is improved, but the workload and complexity increase significantly
Solution Approach 1:
The patent divides the address bit number upgrade process into segments: only the main program is upgraded to the first address bit number, while library functions maintain their original second address bit number. A mapping table is created to bridge the address space between different bit numbers, allowing cross-linking without requiring all components to be upgraded uniformly.
Solution Approach 2:
The patent introduces a mapping table as an intermediary mechanism between the main program (first address bit number) and library functions (second address bit number). This mapping table stores correspondence relationships between addresses of different bit numbers, enabling correct address translation and data access without requiring uniform upgrade of all components.
2Stability of the object's composition
If all compilers generating library functions are upgraded to the first address bit number, then address uniformity is improved, but the development time and productivity are reduced
Solution Approach 1:
The patent allows different segments of the system (main program vs. library functions) to operate with different address bit numbers. The main program uses the first address bit number while library functions retain the second address bit number, eliminating the need to upgrade all compilers and accelerating the development process.
Solution Approach 2:
The patent changes the address bit number parameter selectively: the main program is compiled with the first address bit number while library functions are compiled with the second address bit number. The mapping table dynamically translates between these different parameter settings, maintaining compatibility without requiring uniform parameter changes across all components.
3Reliability
If register addresses are modified using a mapping table, then cross-linking correctness is improved, but the linking process complexity increases
Solution Approach 1:
The patent performs preliminary actions by pre-compiling the main program with the first address bit number and pre-creating the mapping table with address correspondence relationships before the linking process. During linking, the system only needs to query the pre-prepared mapping table and perform straightforward address substitution, rather than performing complex real-time address translation.
Solution Approach 2:
The mapping table is automatically generated and maintained by the linking system itself, storing the correspondence relationships between addresses of different bit numbers. The system uses this self-maintained mapping table to automatically translate addresses during the linking process, reducing the need for manual configuration and external tools.
Data Source
AI summary
Provided are cross-linking method and apparatus, electronic device and storage medium. The method includes: modifying a register address in a first operation instruction of a library function after the register address in the first operation instruction hits a preset mapping table, wherein the mapping table includes a mapping relationship between a target register address of a main program and the register address of the library function, the target register address of the main program is increased to a first address bit number, the register address in the operation instruction of the library function has a second address bit number, the first address bit number is greater than the second address bit number, and the modified register address in the first operation instruction is the target register address of the corresponding main program in the mapping table; and migrating the modified first operation instruction into the main program.

