Cross tool chain
1. Crossover tool is a tool that compiles the program on the arm platform, and the cross tool chain is a collection of cross tools.
2.file filename
Use the file command to view information about the platform the program is running on
3. Cross-development
1. Creating a pattern on the x86 platform to run programs on other platforms is called cross-development
2. Host is the platform to generate embedded software, the target machine is the platform to run the embedded software
Common Cross-tools
1. Cross Compiler
arm-linux-gcc
In the same place
ARM-LINUX-GCC file.c-o File
Same as in GCC usage
The difference
GCC looking for header files from/usr/include/
ARM-LINUX-GCC looking for header files from/usr/loacl/arm/.../lib
Arm-linux-gcc-print-search-dirs View header file path, this option can be found through--help
2. Cross-linker
Arm-linux-ld-tfile.lds file1.o file2.o ...-o file.elf
Link FILE1.O file2.o and file.lds to led.elf file
3. Cross Elf Reader
1.arm-linux-readelf-a file.elf
In the output information data, you can see the running size end mode, machine can see the running processor
2.arm-linux-readelf-d file.elf
To view dynamic runtime information for a program to run
3. General program can not run, through the file viewer processor and size side, Readelf-a View the program's processor and size side, readelf-d View the program's dynamic runtime information
4. Cross-Disassembler
1.arm-linux-objdump-d-S file >dump
Input disassembly file information into dump to save
2.arm-linux-gcc-g file.c-o File
C-language information can be added to the disassembly code to facilitate reading of the code
5. Crossover Converter
1.arm-linux-objcopy-o binary file.elf File.bin
"-o binary" means that the output is in binary format, converting the input file file.elf to the File.bin output
2. The program generated through ARM-LINUX-GCC is an elf-formatted program and cannot be run directly on an ARM processor. The Linux system has an elf converter that can convert the ELF format files to binary files to run. So to run directly on an ARM processor requires converting the ELF format into a binary format
[state-Embedded notes] [016] [Cross tool chain]