Arm-linux Tools

Source: Internet
Author: User
Tags printable characters

The functions of the Arm-linux tool are as follows:

Arm-linux-addr2line converts the program address to the file name and line number. Give it an address and an executable file name on the command line, and it will use the debug information of the executable to indicate which file and line number are on the given address.

Arm-linux-ar Create, modify, and extract archive files. An archive is a large file that contains multiple file contents, and its structure ensures that the original file contents can be restored.

The Arm-linux-c++flit connector uses it to filter C + + and Java symbols to prevent overloaded function collisions.

ARM-LINUX-GPROF displays various data for the program call segment.

Arm-linux-ld is a connector that combines some target and archive files, repositions data, and connects symbolic references. Typically, the final step in building a new compiler is to call LD.

ARM-LINUX-NM lists the symbols in the destination file.

Arm-linux-objcopy Copy the contents of one destination file to another type of destination file.

Arm-linux-objdump displays information about one or more target files. Using options to control the information it displays, the information it displays is usually of interest to the person writing the compilation tool.

Arm-linux-ranlib produces an archive file index and saves it in this archive. The redistribution target files defined by each member of the archive are listed in the index.

Arm-linux-readelf displays information about the ELF format executable file.

Arm-linux-size lists the size of each segment of the target file and the overall size. By default, only one row of output is generated for each module in each target file or in an archive file.

Arm-linux-string prints a printable string of a file that is at least 4 characters long, or you can use option-N to set the minimum length of the string. By default, it prints only the printable characters in the destination file initialization and loadable segments, and for other types of files it prints printable characters for the entire file. This program is useful for understanding the content of non-text files.

Arm-linux-strip discards all or specific symbols in the destination file.

ARM-LINUX-GCC-WALL-O2-C-o [email protected] $<

-O only activates preprocessing, compilation, and assembly, that is, he only makes the program obj file

-wall Specifies that all warning messages are generated

The-O2 compiler provides compiler-optimized options for the program, which can be used at compile time to improve the execution efficiency of the resulting execution file.

-C means that only the compiler is asked to compile, not link, to generate the file name of the source file, but the suffix from. C or. cc into the. O Target file

-S only activates preprocessing and compilation, which means compiling the files into assembly code

ARM-LINUX-LD directly specify the code snippet, data segment, and start address of the BSS segment

-TBSS address Set address of. BSS section

-tdata address Set address of. Data section

-ttext address Set address of. Text section

Example:

${cross}ld-ttext=0x33000000 Led.o-o led.elf

To set an address using a connection script:

Arm-linux-ld-tbeep.lds START.O Beep.o-o beep.elf

Where Beep.lds is the connection script as follows:

Arm-linux-objcopy is used to copy the contents of one destination file into another file, which can be used for format conversion between different source files

Example:

Arm-linux-objcopy–o binary–s Elf_file Bin_file

Common options:

Input-file, Outflie

Input and output files, if not outfile, the output file name is input file name

2.-l Bfdname or-input-target=bfdname

Used to indicate the format of the source file, Bfdname is the standard format name described in the BFD library, and if not specified, arm-linux-objcopy analyze It Yourself

3.-o the format of the Bfdname output

4.-f Bfdname also indicate the source file, the format of the destination file

5.-r sectionname Remove all segments named SectionName from the output file

6.-s does not copy relocation information and symbolic information from the source file into the destination file

7.-g do not copy the debug symbols from the source file to the destination file

Arm-linux-objdump

View the target file (. o file) and library file (. a file) information

arm-linux-objdump-d-M arm beep.elf > Beep.dis

-D displays all assembly information in the file

-M machine

Specifies the schema used when disassembling the target file, which is useful when the disassembly file itself does not describe the schema information (such as S-records). You can use the-I option to list the schemas that can be specified here.

[email protected] asm_c_buzzer]$ cat Beep.lds

/***********************************************************************

* File:beep.lds

* version:1.0.0

* COPYRIGHT:2011 (c) Guo Wenxue <[email protected]>

* Description:cross Tool link text, refer to U-boot.lds

* Changelog:1, Release initial version on "Mon Mar 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)

}

}

[email protected] asm_c_buzzer]$ Cat Makefile

# ***********************************************************************

# * File:makefile

# * version:1.0.0

# * COPYRIGHT:2011 (c) Guo Wenxue <[email protected]>

# * Description:makefile used to cross compile the ASM and C source code

# * Changelog:1, Release initial version on "Mon Mar 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

Turn

Arm-linux Tools

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.