LINUX study notes 22-cross tool chain

Source: Internet
Author: User
Cross tool chain 1. Cross Compilation: embedded system development adopts the cross development mode, which is compiled and generated on machine A and runs on Machine B. The two machines have different machine commands. 2. tool chain: a complete set of tools, such as compilation, compilation, and linking. 3. Role: only compiled programs can be on the target machine... information & nb cross tool chain
 
1. cross-compilation: The Cross-development mode is used for embedded system development. it is compiled and generated on machine A and runs on Machine B. The two machines have different machine commands.
 
2. tool chain: a complete set of tools, such as compilation, compilation, and linking.
 
3. Role: only compiled programs can be run on the target machine. programs compiled with gcc cannot run on the target machine.
 
4. Installation
 
A) unzip the tool chain to tar xvzf arm-linux-gcc-4.3.2.tar.gz-C/
 
I.-C indicates to decompress the package to a directory.
 
B) modify/etc/profile and add pathmunge/opt/FriendlyARM/toolschain/4.5.1/bin
 
I. modify the above address based on the specific decompression path
 
Ii. Otherwise, the path must be added for each use.
 
C) execute source/etc/profile to make it take effect.
 
5. several major commands in the cross tool chain:
 
A) all tools are stored in the/opt/FriendlyARM/toolschain/4.5.1/bin directory.
 
B) compiler: arm-linux-gcc for example: arm-linux-gcc hello. c-o hello
 
C) disassembly tool: compiled code is required.
 
I. Role: used to observe the assembly language code
 
Ii. arm-linux-objdump example: arm-linux-objdump-D-S hello
 
Iii. the assembly code will be directly output in the above case. if you add> hello. log at the end, it will be output to such a file.
 
D) ELF file viewing tool: arm-linux-readelf
 
I. Elf file: format of the file compiled by arm-linux-gcc
 
Ii. run arm-linux-readelf-a hello to check the ELF header information and check whether the Data size and machine target meet the requirements.
 
Iii. arm-linux-readelf-d hello view the dynamic library used by hello
 
1) role: sometimes you will find that there is a program clearly, but the system will still report the error that the program cannot be found during running, so there may be no dynamic link library. Solution: Copy the corresponding dynamic link library to lib.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.