A kind of instruction address adaptive relocation method and program compilation 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 delays, highlighting substantive features, and reducing read data delays
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0045] like figure 1 As shown, the technical solution of the present invention provides an instruction address adaptive relocation method, which uses 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 executable target files and configuration information;
[0047] S1-2: Slice the code segment and data segment in the executable object file;
[0048] S1-3: After the executable object file is divided, the corresponding memory space is divided 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-address each segment in the executable target file, and finally perform target linking, and output the optimized executable target file.
[0051] In this method, a processing process is added after the linking stage. In this embodiment, the prepro...
Embodiment 2
[0053] like figure 2 As shown, the technical solution of the present invention provides an instruction address adaptive relocation method, the executable object file generated in the linking stage of the program compilation process is used as the source file, and the method includes the following steps:
[0054] S2-1: Read the executable object file and configuration information; it should be noted that the configuration information includes memory configuration information and optimized configuration information; first, the configuration information is given according to the characteristics of the memory used. For the memory configuration information, see image 3 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 during the program compilation process, and the optimization strength ranges from 0 to n (n=1, 2,...
Embodiment 3
[0067] like Figure 4 As shown, this embodiment provides a method for compiling a program. In this embodiment, a gcc compiler in a linux environment is used 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 phase, the compiler checks the normativeness of the code and determines that the syntax is correct, and then translates the code into assembly language;
[0070] S3-3: The assembler in the assembly stage converts the assembly language into binary object code, where the object code includes relocatable object files, executable object code and sharable object code;
[0071] S3-4: Linking stage The linker links multiple relocatable object files into executable object files; the linking process is a module assembly process,...
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