Instruction address self-adaptive relocation method and program compiling method
A technology of instruction address and program compilation, which is applied in the field of program compilation, can solve problems such as reading data delays and reducing CPU execution efficiency, and achieve the effects of reducing the number of pre-charging operations, highlighting substantive features, and reliable design principles
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0045] Such as figure 1 As shown, the technical solution of the present invention provides a method for adaptive relocation of instruction addresses, using the executable object file generated in the linking stage of the program compilation process as the source file, and the method includes the following steps:
[0046] S1-1: Read the executable target file and configuration information;
[0047] S1-2: slicing the code segment and data segment in the executable object file;
[0048] S1-3: After the executable target file is divided, divide the corresponding memory space according to the size of each segment;
[0049]S1-4: Calculate the actual target value;
[0050] S1-5: When the actual target value is less than the set target value, re-locate the address of each segment in the executable target file, and finally perform target linking, and output the optimized executable target file.
[0051] This method is to add a processing process after the linking stage. In this embo...
Embodiment 2
[0053] Such as figure 2 As shown, the technical solution of the present invention provides a method for self-adaptive relocation of instruction addresses. The executable target file generated in the linking stage of the program compilation process is used as the source file. The method includes the following steps:
[0054] S2-1: Read the executable target file and configuration information; it should be noted that the configuration information includes memory configuration information and optimization configuration information; firstly, according to the characteristics of the memory used, the configuration information is given. For memory configuration information, see image 3 As shown; the optimization configuration can be passed through parameters when compiling, and the optimization configuration information includes the optimization strength and the number of iterations set in the compilation stage of the program compilation process, and the optimization strength is from...
Embodiment 3
[0067] Such as Figure 4 As shown, this embodiment provides a program compilation method. In this embodiment, the gcc compiler under the linux environment is taken as an example (the compiler is not limited here). To compile a C program, the compilation method includes the following steps:
[0068] S3-1: In the preprocessing stage, the preprocessor compiles the header files included in the C source code to form a preprocessing file;
[0069] S3-2: In the compilation stage, the compiler checks the standardization of the code and translates the code into assembly language after confirming that the syntax is correct;
[0070] S3-3: In the assembly stage, the assembler converts the assembly language into binary object codes, wherein the object codes include relocatable object files, executable object codes, and shareable object codes;
[0071] S3-4: Linking stage The linker links multiple relocatable object files into an executable object file; the linking process is a module as...
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com