User mode binary program instruction set compatible method, system and equipment
By inserting and configuring alt instr instructions during the compilation and linking stage, the binary program's CO-RE between different CPU instruction set versions is solved, and the compatibility and performance utilization problems are achieved, and high compatibility and high performance binary programs are achieved. run.
Patent Information
- Application Number
- CN202411597896.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-11
- Publication Date
- 2025-02-18
AI Technical Summary
The prior art is difficult to flexibly switch between different CPU instruction set versions, resulting in illegal instruction errors that may occur when binary programs run in low-version instruction set environments and cannot fully utilize the hardware characteristics of higher-version CPUs.
By initializing the alt instr instruction replacement environment during the compilation stage, inserting the alt instr instruction into the source code, and inserting the multi-instruction set feature section in the link stage, using the alt instr constructor configured with priority to replace the instructions, supporting binary programs to different instructions CO-RE between set architectures.
It realizes flexible switching between different CPU instruction set versions, enhances compatibility, and can utilize the hardware characteristics of the higher-version instruction set CPU to improve performance and energy efficiency.
Smart Images

Figure CN119473395A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of binary program compatibility, and in particular to a user-mode binary program instruction set compatibility method, system and device. Background Art
[0002] In modern computer systems, the operating system is the core program that manages and controls computer hardware and software resources. It consists of two major parts: software and configuration. In the software part, executable binary programs are the key components of the operating system to perform tasks. These programs are compiled from source code by a compiler, and the compilation process depends on a specific architecture instruction set. Usually, the compiler uses a default instruction set, or developers can specify a specific instruction set through compilation parameters. The resulting executable binary program contains instructions corresponding to a specific CPU architecture, and these instructions can only run on a CPU that supports the corresponding instruction set architecture.
[0003] In specific CPU architectures such as x86 or ARM, higher-version instruction sets are often backward compatible with lower-version instruction sets. For example, software developed based on the Armv8.2-A instruction set can run on a CPU that supports the Armv8.3-A instruction set, but the reverse is not true. This compatibility allows software to run on different versions of CPU instruction sets, but it also brings challenges: when the CPU instruction set version of the operating environment is lower than the CPU instruction set required by the binary program, the program may encounter an illegal instruction error during operation, causing the program to crash.
[0004] In order to improve the compatibility of software, developers usually choose a lower version of the instruction set when building the software, so that the software can be executed in both the lower and higher version instruction set operating environments. However, CPUs that support higher version instruction sets usually contain more instructions, which are usually better than the functions implemented by the software in terms of performance or energy efficiency. If a higher version instruction set is selected as the compilation environment, the generated binary program can make full use of these hardware features, but at the expense of compatibility in the lower version instruction set environment. On the contrary, if the software is built in the compilation environment of a lower version instruction set, although it can guarantee operation in the higher version instruction set environment, it cannot take advantage of the hardware features of the higher version CPU.
[0005] In actual production, this compatibility issue is particularly prominent. For example, a specific version of Chromium software encountered an illegal instruction error when running on Kunpeng 920. The reason is that the Chromium software contains the paciasp instruction, which belongs to the Armv8.3-A instruction set, while Kunpeng 920 only supports the Armv8.2-A instruction set. This problem causes this version of Chromium software to be unable to run in all ARM64 environments that do not support the paciasp instruction. The root of the problem is that this version of Chromium software is compiled in an environment that supports the Armv8.3-A instruction set, so its binary program contains the paciasp instruction unique to Armv8.3-A.
[0006] In summary, from the perspective of compatibility and stability, developers usually choose to compile and build software in a lower version of the instruction set environment to improve the compatibility and stability of the software. However, this practice limits the ability of the software to fully utilize the latest hardware features, resulting in potential losses in performance and energy efficiency.
[0007] Therefore, how to provide a software building and running mechanism that can flexibly switch between different instruction set versions while maintaining high performance and high compatibility has become a technical problem that needs to be solved urgently. Summary of the invention
[0008] In view of this, in order to overcome the deficiencies of the prior art, the present invention aims to provide a user-mode binary program instruction set compatibility method, system and device.
[0009] According to a first aspect of the present invention, a method for user-mode binary program instruction set compatibility is provided, the method comprising: During the compilation phase of building a binary program, the alt instr command replacement environment is initialized and the alt instr command is inserted into the source code; During the linking phase of building a binary program, a multi-instruction set feature section is inserted, and during the execution of the built binary program, the alt instr constructor is prioritized; By executing the alt instr constructor configured with priority, the alt instr instructions in the multiple instruction set feature section are traversed to determine whether to perform instruction replacement. When instruction replacement is required, instruction replacement is performed first and then the main function of the program is executed.
[0010] Preferably, in the user-mode binary program instruction set compatibility method of the present invention, initializing the alt instr instruction replacement environment and inserting the alt instr instruction into the source code includes: obtaining and compiling the source code, adding alt instr compilation parameters and alt instr constructors, and inserting the alt instr instruction into the source code through the alt instr compilation parameters.
[0011] Preferably, in the user-mode binary program instruction set compatibility method of the present invention, initializing the alt instr instruction replacement environment and inserting the alt instr instruction into the source code also includes: inserting the alt instr instruction into the source code by hard coding the source code.
[0012] Preferably, in the user-mode binary program instruction set compatibility method of the present invention, the multi-instruction set characteristic section is used to store alt instr metadata and instructions and mark the location information of the alt instr metadata and instructions.
[0013] Preferably, in the user-mode binary program instruction set compatibility method of the present invention, during the execution of the constructed binary program, the alt instr constructor is prioritized, including: configuring a constructor hidden priority for the alt instr constructor, wherein the constructor hidden priority is higher than other constructor priorities that can be encoded by the user.
[0014] Preferably, in the user-mode binary program instruction set compatibility method of the present invention, the alt instr instructions of multiple instruction set feature sections are traversed by executing the alt instr constructor with execution priority configuration, including: executing the alt instr constructor with execution priority configuration, and traversing the alt instr instructions in multiple instruction set feature sections according to the alt instr metadata and the location information mark of the instruction.
[0015] Preferably, in the user-mode binary program instruction set compatibility method of the present invention, determining whether to perform instruction replacement includes: matching the CPU characteristics of the operating environment with the CPU characteristics of the alt instr instruction, and when the CPU characteristics of the operating environment match the CPU characteristics of the alt instr instruction, determining that instruction replacement is required; when the CPU characteristics of the operating environment do not match the CPU characteristics of the altinstr instruction, determining that instruction replacement is not required.
[0016] Preferably, in the user-mode binary program instruction set compatibility method of the present invention, when instruction replacement is required, instruction replacement is performed first and then the main function of the program is executed, including: when the length of the replaced instruction is less than the length of the instruction before replacement, the length of the replaced instruction is padded with an empty instruction.
[0017] According to a second aspect of the present invention, there is provided a user-mode binary program instruction set compatible system, the system comprising an instruction set compatible server, the instruction set compatible server being used to: in the compile phase of building a binary program, initialize an alt instr instruction replacement environment and insert alt instr instructions into source code; in the link phase of building a binary program, insert a multi-instruction set feature section, and in the process of executing the built binary program, perform priority configuration on the alt instr constructor; traverse the alt instr instructions of the multi-instruction set feature section by executing the alt instr constructor with the priority configuration, determine whether to perform instruction replacement, and when instruction replacement is required, perform instruction replacement before starting to execute the main function of the program.
[0018] According to a third aspect of the present invention, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described in the first aspect of the present invention when executing the program.
[0019] The present invention, through a user-mode binary program instruction set compatibility method, system and device, implements traversing the alt instr data structure in the program by inserting alt instr related sections in the link script during the software construction phase; introduces a hidden highest priority constructor during the compilation phase, and uses this highest priority constructor to implement binary program instruction replacement; before the program runs, the instruction replacement is performed in the constructor by writing / proc / self / mem to support the CO-RE of the binary program for the instruction set architecture; thereby implementing a CO-RE binary program that supports the instruction set, which is used to enhance the compatibility of the binary program with different CPU instruction sets. The present invention avoids the drawbacks of binary program compilation and operation in the prior art, not only has high compatibility, but also can use high-version instruction set CPU hardware characteristics. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0021] Figure 1 This is an example diagram of the architecture of a user-mode binary program instruction set compatible system according to an embodiment of the present invention; Figure 2 A flowchart of a method for compatibility of user-mode binary program instruction sets according to an embodiment of the present invention; Figure 3 A schematic diagram of the structure of the device provided by the present invention. DETAILED DESCRIPTION
[0022] The embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0023] It should be noted that the following embodiments and features in the embodiments may be combined with each other in the absence of conflict; and, based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without making any creative work are within the scope of protection of the present disclosure.
[0024] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. It should be apparent that the aspects described herein may be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on the present disclosure, it should be understood by those skilled in the art that an aspect described herein may be implemented independently of any other aspect, and two or more of these aspects may be combined in various ways. For example, any number of aspects described herein may be used to implement the device and / or practice the method. In addition, other structures and / or functionalities other than one or more of the aspects described herein may be used to implement this device and / or practice this method.
[0025] Figure 1 FIG. 1 is an example diagram of an architecture of a user-mode binary program instruction set compatible system according to an embodiment of the present invention. Figure 1 As shown, the system may include an instruction set compatible server 101, a communication network 102 and / or one or more instruction set compatible clients 103. Figure 1 The example is a client 103 compatible with multiple instruction sets.
[0026] The instruction set compatible server 101 can be any appropriate server for storing information, data, programs and / or any other suitable type of content. In some embodiments, the instruction set compatible server 101 can perform appropriate functions. For example, in some embodiments, the instruction set compatible server 101 can be used for user-mode binary program instruction set compatibility. As an optional example, in some embodiments, the instruction set compatible server 101 can be used to achieve user-mode binary program instruction set compatibility by replacing instructions. For example, the instruction set compatible server 101 can be used to: initialize the alt instr instruction replacement environment and insert the alt instr instruction into the source code during the compilation phase of building a binary program; insert multiple instruction set feature sections during the link phase of building a binary program, and configure the alt instr constructor with priority during the execution of the built binary program; traverse the alt instr instructions of the multiple instruction set feature sections by executing the alt instr constructor with priority configuration, determine whether to perform instruction replacement, and when instruction replacement is required, perform instruction replacement before starting to execute the main function of the program.
[0027] As another example, in some embodiments, the instruction set compatible server 101 may send the user-mode binary program instruction set compatible method to the instruction set compatible client 103 for user use based on the request of the instruction set compatible client 103 .
[0028] As an optional example, in some embodiments, the instruction set compatible client 103 is used to provide a visual instruction set compatible interface, which is used to receive a user's selection input operation for performing user-mode binary program instruction set compatibility based on compilation and instruction replacement, and to, in response to the selection input operation, obtain from the instruction set compatible server 101 an instruction set compatible interface corresponding to the option selected by the selection input operation and display the instruction set compatible interface, wherein the instruction set compatible interface at least displays information on performing user-mode binary program instruction set compatibility based on compilation and instruction replacement and operation options for the information on performing user-mode binary program instruction set compatibility based on compilation and instruction replacement.
[0029] In some embodiments, the communication network 102 can be any suitable combination of one or more wired and / or wireless networks. For example, the communication network 102 can include any one or more of the following: the Internet, an intranet, a wide area network (WAN), a local area network (LAN), a wireless network, a digital subscriber line (DSL) network, a frame relay network, an asynchronous transfer mode (ATM) network, a virtual private network (VPN), and / or any other suitable communication network. The instruction set compatible client 103 can be connected to the communication network 102 via one or more communication links (e.g., communication link 104), and the communication network 102 can be linked to the instruction set compatible server 101 via one or more communication links (e.g., communication link 105). The communication link can be any communication link suitable for transmitting data between the instruction set compatible client 103 and the instruction set compatible server 101, such as a network link, a dial-up link, a wireless link, a hardwired link, any other suitable communication link, or any suitable combination of such links.
[0030] The instruction set compatible client 103 may include any one or more clients that present an interface related to user-mode binary program instruction set compatibility based on compilation and instruction replacement in an appropriate form for use and operation by the user. In some embodiments, the instruction set compatible client 103 may include any suitable type of device. For example, in some embodiments, the instruction set compatible client 103 may include a mobile device, a tablet computer, a laptop computer, a desktop computer, and / or any other suitable type of client device.
[0031] Although the instruction set compatible server 101 is illustrated as one device, in some embodiments, any suitable number of devices may be used to perform the functions performed by the instruction set compatible server 101. For example, in some embodiments, multiple devices may be used to implement the functions performed by the instruction set compatible server 101. Alternatively, a cloud service may be used to implement the functions of the instruction set compatible server 101.
[0032] Based on the above system, an embodiment of the present invention provides a user-mode binary program instruction set compatibility method, which is described below through the following embodiments.
[0033] Figure 2 1 is a flowchart of the steps of a method for compatibility of user-mode binary program instruction sets according to an embodiment of the present invention. The method for compatibility of user-mode binary program instruction sets according to this embodiment can be executed at an instruction set compatibility server end, such as Figure 2 As shown, the user-mode binary program instruction set compatibility method includes the following steps: Step S201: during the compilation phase of building a binary program, an alt instr instruction replacement environment is initialized and an alt instr instruction is inserted into the source code.
[0034] In order to realize the CO-RE (Compile Once – Run Everywhere) feature of binary programs, i.e., the feature of compiling once and running everywhere, this embodiment sets instructions of both the old and new instruction sets in the executable binary program, and dynamically replaces instructions according to the CPU hardware features of the running environment before the program starts running (usually before the main function starts executing). In this embodiment, the feature of the code containing instructions of multiple instruction sets at the same time is called alternstructions.
[0035] This embodiment implements the method of simultaneously including the characteristics of multiple instruction set instructions in the code, including hard coding and compiler implementation.
[0036] As an optional example, this embodiment can insert the altinstr instruction into the source code by hard coding the source code. For example, hard coding is performed in the software source code so that the compiled binary executable program contains instructions of different CPU characteristics at the same time.
[0037] As an optional example, this embodiment can obtain and compile source code, add alt instr compilation parameters and alt instr constructors, and insert alt instr instructions into the source code through the altinstr compilation parameters. For example, the compiler implements the -alt-compat-FEATURE or -march-compat=Armv8.3-A, Armv8.2-a feature, and dynamically inserts instructions corresponding to different CPU features according to the compilation parameters during the compilation stage. The compiler compiles and builds software based on the benchmark (benchmark: the compiler's current default instruction set) instruction set, and combines alt-instr to achieve program compatibility with higher version instruction sets.
[0038] In this embodiment, whether inserting alternstructions into the code is implemented by program hard coding or compiler implementation, the insertion of the alt instr instruction can be implemented.
[0039] Step S202: During the linking phase of building a binary program, a multi-instruction set feature section is inserted, and during the execution of the built binary program, a priority is configured for the alt instr constructor.
[0040] In this embodiment, the compiler inserts the alt instr instruction into the code during the compiling phase. In order to be able to traverse all alt instr in the code in the early stage of program running, a special section, namely the multi-instruction set feature section, is inserted during the linking phase of binary program construction to store the alt instr instruction.
[0041] In this embodiment, the multi-instruction set characteristic section is used to store alt-instr metadata and instructions and mark the location information of alt-instr metadata and instructions. For example, in this embodiment, the binary program includes alt-instr instructions, and the binary executable program has a .altinstructions section for storing and marking the location of alt-instr in the executable program or memory.
[0042] In order to perform instruction replacement before the program is officially run, it is necessary to execute a section of code before the program is run through the compiler's "constructor" feature, such as GCC's __attribute__((constructor(prio))). It should be noted that this embodiment configures a constructor hidden priority for the alt instr constructor, and the constructor hidden priority is higher than the priority of other constructors that the user can encode, thereby preventing the "constructor" that originally exists in the code from being executed before the alt instr instruction is replaced.
[0043] Step S203: traverse the altinstr instructions of the multi-instruction set feature section by executing the alt instr constructor configured with priority, and determine whether to perform instruction replacement. When instruction replacement is required, perform instruction replacement first and then start executing the main function of the program.
[0044] This embodiment executes the alt instr constructor with priority configuration, and traverses the alt instr instructions in the multiple instruction set feature section according to the alt instr metadata and the location information tag of the instruction.
[0045] The CPU characteristics of the operating environment are matched with the CPU characteristics of the alt instr instruction. When the CPU characteristics of the operating environment match the CPU characteristics of the alt instr instruction, it is determined that instruction replacement is required; when the CPU characteristics of the operating environment do not match the CPU characteristics of the alt instr instruction, it is determined that instruction replacement is not required.
[0046] It should be noted that, in this embodiment, when the length of the replaced instruction is smaller than the length of the replaced instruction, a null instruction is used to fill the length of the replaced instruction.
[0047] This embodiment takes Chromium as an example, and describes the user-mode binary program instruction set compatibility method of this embodiment in detail in a specific scenario as follows: 1. After obtaining the source code, start compiling; 2. Add alt-instr related compilation parameters to insert alt instr instructions in the code and insert alt instr constructors in the program. For example, to build a chromium program that supports both Armv8.3-A and Armv8.2-a instruction sets, add -march-compat=Armv8.3-A,Armv8.2-a parameters; 3. During the linking process, add a .altinstructions section for the alt-instr directive to store alt-instr metadata and instructions; 4. Generate executable binary program; 5. Start executing the executable binary program. The operating system kernel loads the binary program and the dynamic loader into the memory and hands control to the loader. The loader performs necessary operations such as dynamic library loading. 6. Execute the alt instr constructor. The constructor first traverses all alt instr instructions in the program. If the CPU in the current operating environment does not support the alt instr instruction, the replacement of this alt instr is skipped; if it is supported, the instruction replacement work is performed in the memory by opening / proc / self / mem. In order to ensure that the length of the replaced instruction is less than the length of the instruction before replacement, it is padded with empty instructions (such as nop instructions). In addition, the alt instr instruction inserted by the compiler during the compilation phase will ensure that the length of the instruction before replacement must be greater than the length of the instruction after replacement; 7. After the instruction is replaced, the program jumps to the main() function to start execution.
[0048] In the prior art, software compiled and built in a high-version instruction set environment can bring into play more CPU hardware features, but has poor compatibility and cannot run in a low-version instruction set environment; software compiled and built in a low-version instruction set environment has higher compatibility, but cannot use CPU hardware features in a high-version instruction set running environment.
[0049] The user-mode binary program instruction set compatibility method and system of this embodiment, in the software construction stage, by inserting the alt instr related section in the link script, realizes traversing the alt instr data structure in the program; introduces a hidden highest priority constructor in the compilation stage, and uses this highest priority constructor to realize binary program instruction replacement; before the program runs, the instruction replacement is performed in the constructor by writing / proc / self / mem to support the CO-RE of the binary program for the instruction set architecture; thereby realizing the CO-RE binary program supporting the instruction set, which is used to enhance the compatibility of the binary program with different CPU instruction sets. The present invention avoids the drawbacks of binary program compilation and operation in the prior art, not only has high compatibility, but also can use the high version instruction set CPU hardware characteristics.
[0050] like Figure 3 As shown, the present invention also provides a device, including a processor 310, a communication interface 320, a memory 330 for storing a processor executable computer program, and a communication bus 340. The processor 310, the communication interface 320, and the memory 330 communicate with each other through the communication bus 340. The processor 310 implements the above-mentioned user-mode binary program instruction set compatibility method by running an executable computer program.
[0051] Among them, the computer program in the memory 330 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0052] The system embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, i.e., they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected based on actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art may understand and implement it without creative effort.
[0053] Through the description of the above implementation modes, those skilled in the art can clearly understand that each implementation mode can be implemented by means of software plus a necessary general hardware platform, or of course by hardware. Based on such an understanding, the above technical solution can essentially or in other words be embodied in the form of a software product that contributes to the prior art. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or some parts of the embodiment.
[0054] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. A user-mode binary program instruction set compatibility method, characterized in that: The method comprises: During the compilation phase of building a binary program, the alt instr instruction replacement environment is initialized and the alt instr instruction is inserted into the source code; During the linking phase of building a binary program, a multi-instruction set feature section is inserted, and during the execution of the built binary program, the alt instr constructor is prioritized; By executing the alt instr constructor configured with priority, the alt instr instructions in the multiple instruction set feature section are traversed to determine whether to perform instruction replacement. When instruction replacement is required, instruction replacement is performed first and then the main function of the program is executed.
2. The user-mode binary program instruction set compatibility method according to claim 1, characterized in that: Initialize the altinstr instruction replacement environment and insert the alt instr instruction into the source code, including: obtaining and compiling the source code, adding the altinstr compilation parameter and the alt instr constructor, and inserting the alt instr instruction into the source code through the alt instr compilation parameter.
3. The user-mode binary program instruction set compatibility method according to claim 1, characterized in that: Initializing the alt instr instruction replacement environment and inserting the alt instr instruction into the source code also includes: inserting the alt instr instruction into the source code by hard coding the source code.
4. The user-mode binary program instruction set compatibility method according to claim 1, characterized in that: The multiple instruction set feature section is used to store alt instr metadata and instructions and mark the location information of alt instr metadata and instructions.
5. The user-mode binary program instruction set compatibility method according to claim 1, characterized in that: During execution of the built binary program, the priority of the alt instr constructor is configured, including: configuring a constructor hiding priority for the alt instr constructor, wherein the constructor hiding priority is higher than other constructor priorities that can be encoded by the user.
6. The user-mode binary program instruction set compatibility method according to claim 1, characterized in that: The alt instr instructions of the multiple instruction set feature section are traversed by executing the alt instr constructor configured with execution priority, including: executing the alt instr constructor configured with execution priority, and traversing the alt instr instructions in the multiple instruction set feature section according to the alt instr metadata and the location information tag of the instruction.
7. The user-mode binary program instruction set compatibility method according to claim 1, characterized in that: Determining whether to perform instruction replacement includes: matching the CPU characteristics of the operating environment with the CPU characteristics of the alt instr instruction, and determining that instruction replacement is required when the CPU characteristics of the operating environment match the CPU characteristics of the alt instr instruction; and determining that instruction replacement is not required when the CPU characteristics of the operating environment do not match the CPU characteristics of the alt instr instruction.
8. The user-mode binary program instruction set compatibility method according to claim 1, characterized in that: When instruction replacement is required, the instruction replacement is performed first and then the main function of the program is executed, including: when the length of the replaced instruction is less than the length of the instruction before replacement, the length of the replaced instruction is filled with a null instruction.
9. A user-mode binary program instruction set compatible system, characterized in that: The system includes an instruction set compatible server, which is used to: initialize an alt instr instruction replacement environment and insert alt instr instructions into source code during the compile phase of building a binary program; insert multiple instruction set feature sections during the link phase of building a binary program, and perform priority configuration on the alt instr constructor during the execution of the built binary program; traverse the alt instr instructions of the multiple instruction set feature sections by executing the alt instr constructor with priority configuration to determine whether to perform instruction replacement, and when instruction replacement is required, perform instruction replacement before starting to execute the main function of the program.
10. A computer device, characterized in that: The computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the method according to any one of claims 1 to 8 when executing the program.
Citation Information
Cited By
Instruction set conversion-based credential application compatible adaptation method and system
CN119808081A