Arm-linux cross-compilation tool

Source: Internet
Author: User
Tags printable characters
Arm-linux compiler cross tool detailed description arm-linux tool functions are as follows: arm-linux-addr2line program address to convert the file name and line number. In the command line, give it an address and an executable file name, it will use the debugging information of this executable file to point out that the given address is the arm-linux compiler cross tool. the features of the arm-linux tool are described as follows: the arm-linux-addr2line converts a program address to a file name and line number. In the command line, give it an address and an executable file name, and it will use the debugging information of this executable file to indicate which file is on the given address and the row number. Arm-linux-ar creates, modifies, and extracts archive files. An archive file is a large file that contains multiple files. its structure ensures that the original file content can be restored. The arm-linux-c ++ flit connector uses it to filter the C ++ and Java symbols to prevent overload function conflicts. Arm-linux-gprof displays various data of the program call segment. Arm-linux-ld is a connector that combines some objects with archive files, relocates data, and connects symbol references. Generally, the last step to create a new compilation program is to call ld. Arm-linux-nm lists the symbols in the target file. Arm-linux-objcopy copies the content of a target file to another type of target file. Arm-linux-objdump displays information about one or more objects. The options are used to control the information displayed by the compiler. The information displayed by the compiler is usually only interested in the compilation tool. Arm-linux-ranlib generates an archive file index and saves it to this archive file. The index lists the allocable target files defined by the archive file members. Arm-linux-readelf displays information about executable files in elf format. Arm-linux-size lists the size of each segment of the target file and the total size. By default, only one output line is generated for each module in each target file or archive file. Arm-linux-string prints printable strings of a file. These strings are at least 4 characters long. you can also use option-n to set the minimum length of the string. By default, it only prints printable characters in the initialization and loading segments of the target file. for other types of files, it prints printable characters of the entire file. This program is very helpful for understanding the content of non-text files. Arm-linux-strip discards all or specific symbols in the target file. Arm-linux-gcc-wall-O2-c-o $ <-o only activates preprocessing, compilation, and assembly, that is, he only makes the program into the obj file-Wall to specify to generate all warning information-the compilation optimization options provided by the O2 compiler for the program are used during compilation, this improves the execution efficiency of the generated execution file.-c indicates that only the compiler is required to compile the file, instead of linking the file. the generated file is named by the file name of the source file, but its suffix is changed from. c or. cc. o's target file-S only activates preprocessing and compilation, which means to compile the file into an assembly code arm-linux-ld and directly specify the code segment and data segment, start ADDRESS of the BSS segment-Tbss address Set ADDRESS. bss section-Tdata ADDRESS Set address. data section-Ttext ADDRESS Set address. text section example: $ {CROSS} ld-Ttext = 0x33000000 led. o-o led. elf uses the connection script to set the address: arm-linux-ld-Tbeep. lds start. o beep. o-o beep. in elf, beep. the lds connection script is as follows: arm-linux-objcopy is used to copy the content of a target file to another file. it can be used for format conversion between different source files. example: arm-linux-objcopy-o binary-S elf_file bin_file: input-file, outflie input and output files. If no outfile exists, the output file name is 2. -l bfdname or-input-target = bfdname is used to specify the source file format. bfdname is the standard format name described in the BFD Library. if it is not specified, arm-linux-objcopy analysis by yourself 3. -O B Fdname output format 4. -F bfdname: specifies the source file in the format of the target file. -R sectionname: delete all segments named sectionname from the output file. 6. -S does not copy the relocation information and symbolic information from the source file to the target file. 7. -g does not copy the debugging symbol from the source file to the target file. arm-linux-objdump (. o files) and library files (. file a) Information about arm-linux-objdump-D-m arm beep. elf> beep. dis-D displays all the assembly information in the file-m machine specifies the architecture used for the disassembly target file. when the disassembly file itself does not describe the architecture information (such as S-records ), this option is useful. You can use the-I option to list the architectures that can be specified here. [guowenxue @ localhost asm_c_buzzer] $ cat beep. lds /************************************** * ********************************** File: beep. lds * Version: 1.0.0 * Copyright: 2011 (c) Guo Wenxue * Description: Cross tool link text, refer to u-boot.lds * ChangeLog: 1, release initial version on "Mon Mar 21 21:09:52 CST 2011 "**************************** **************************************** * ***/OUTPUT_FORMAT ("elf32-littlearm ", "elf32-littlearm", "elf32-littlearm") OUTPUT_ARCH (arm) ENTRY (_ start) SECTIONS {. = 0x33000000 ;. text :{*(. text )*(. rodata )}. data ALIGN (4 ):{*(. data )}. bss ALIGN (4 ):{*(. bss )}} [guowenxue @ localhost asm_c_buzzer] $ cat makefile #****************************** **************************************** * # * File: makefile # * Version: 1.0.0 # * Copyright: 2011 (c) Guo Wenxue # * Description: Makefile used to cross compile the ASM and C source code # * ChangeLog: 1, release initial version on "Mon Mar 21 21:09:52 CST 2011 "#*#************************* **************************************** * CROSS =/opt/buildroot-2011.02/arm920t/usr/bin/arm-linux-CFLAGS = beep. bin: start. S beep. c arm-linux-gcc $ (CFLAGS)-c-o start. o start. S arm-linux-gcc $ (CFLAGS)-c-o beep. O beep. c arm-linux-ld-Tbeep. lds start. o beep. o-o beep. elf arm-linux-objcopy-O binary-S beep. elf beep. bin rm-f *. elf *. o install: cp beep. bin ~ /Winxp-f -- reply = yes clean: rm-f *. elf *. o rm-f beep. bin
Related Article

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.