Debugging Relocatable Programs via ARM Linker Segmentation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing debugging methods for embedded systems cannot directly load and debug relocatable object codes or dynamically loaded relocatable programs, limiting the ability to efficiently develop and debug applications on non-smartphones.
Innovation Solution
A method for loading relocatable programs on an ARM compiler system by comparing segment orders, compiling and linking them to generate an executable ELF file, and setting specific linker options to ensure correct symbol alignment and segment preservation, allowing direct loading and debugging of relocatable files.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If existing debugging methods are used for embedded systems, then debugging of compiled and linked executable object codes can be achieved, but debugging of relocatable object codes and dynamically loaded relocatable programs cannot be performed
Solution Approach 1:
The patent segments the debugging process into distinct phases: loading the relocatable program into memory with proper segment ordering, compiling and linking to generate an executable file, and then debugging. This segmentation allows each phase to be handled independently, enabling debugging of relocatable programs while maintaining system manageability.
Solution Approach 2:
The patent performs preliminary actions by loading the relocatable program into memory and comparing segment orders before actual debugging. The ARM compiler and linker are configured in advance with specific options to preserve segments and handle symbol resolution, preparing the system for subsequent debugging operations on relocatable programs.
2Productivity
If relocatable programs are loaded dynamically, then development efficiency is improved and hardware resources are saved, but existing debugging tools cannot directly load relocatable files for debugging
Solution Approach 1:
The patent introduces an intermediary process that acts as a bridge between the relocatable program and existing debugging tools. The ARM compiler and linker serve as intermediaries, transforming the relocatable program into an executable file format that debugging tools can directly load and analyze, thus maintaining ease of operation while enabling dynamic loading benefits.
Solution Approach 2:
The patent changes key parameters of the ARM compiler and linker to enable relocatable program debugging. Specific linking process parameters are modified to preserve all segments, resolve undefined symbols to a default startup interface, and generate executable files with proper segment ordering that matches the loaded program, making debugging operations straightforward.
3Device complexity
If segment order is not verified during loading, then loading process is simplified, but incorrect segment ordering prevents proper program execution and debugging
Solution Approach 1:
The patent implements feedback by comparing the segment order of the loaded relocatable program with the expected segment order from the ARM image file. This feedback mechanism verifies that segments are loaded in the correct order, ensuring program execution reliability while keeping the loading process manageable through automated verification.
Solution Approach 2:
The patent performs preliminary verification of segment ordering during the loading phase, before execution and debugging. By checking segment order upfront and correcting it if necessary, the system ensures reliable program execution without adding significant complexity to the overall loading process.
Data Source
AI summary
A loading and debugging method and a debugging system thereof are disclosed in the present invention, wherein the debugging method includes: loading a relocatable program according to an order of input segments in an ARM image file; compiling a link of the loaded relocatable program to generate an executable file; and loading the executable file into a debugging tool, to realize the debugging of the relocatable program. The present invention achieves the debugging of a dynamic program loaded dynamically, and addresses the issue that the symbol information of the loaded relocatable file cannot be acquired and the code debugging cannot be performed directly when the relocatable file is loaded dynamically.


