Binutils tool Set, software development weapon

Source: Internet
Author: User

In the Binutils toolset, the following tools are what we need to know when doing embedded software development:

As is the assembler compiler for converting assembly code to a target file.

Add2line the user obtains the program instruction address corresponding function, as well as the function's source file name and the letter number;

AR is used to create and modify an archive file, and to extract files from an archive file. A static library (. A file) is an archive file that needs to be generated and managed;

LD: linker;

NM: Used to list symbols and symbols in the program files in memory (start) address; the symbol contains the function name and the variable name in the C program;

Objcopy: Used to copy the segment we specified from the program file. Code format conversion.

Objdump: can display the program file related information and the program file disassembly;

Ranlib: A content index that is used to generate an archive file to speed up the search for an archive file. Applying the tool to a static library can improve the efficiency of the library's participation in the link.

Size: Used to understand the sizes of the segments in the program file.

Strings: Used to view a display string within a program file.

Strip: The debugging information used to strip the program files to reduce the storage space occupied by the files.


Here are some of their specific uses:

1. Addr2line [Address]-f-e [application name]





2, AR: Static library generator

Parameters of ar:

C: Indicates the creation of an archive file;

R: Indicates that the file is added to the library file created;

S: to generate a library index to increase the efficiency of the library when it is linked.


3, NM symbol display


In general, NM is used to list symbols in program files. Each of the lines listed in NM is made up of three parts.

The first column refers to the address of the symbol in memory when the program runs. It represents the starting address of a function or variable;

The second column: refers to the corresponding symbol stored in which paragraph;

The third column: is the name of the symbol;


For the second column:

A: Indicates that the symbol corresponds to the value of absolute and in the subsequent connection process will not change;

B or B: Indicates that the symbol is in an uninitialized data segment;

C: Indicates a public symbol that is not initialized;

D or D: indicates that the symbol is in the initialized data segment (. Data segment).

N: Indicates that the symbol is not used for debugging.

P: Indicates that the symbol is in a stack backtracking segment.

R or R: indicates that the symbol is in a read-only data segment (. Rdata segment).

T or T: Indicates that the symbol is in a code snippet (. Text segment).

U: Indicates that the symbol is not defined.


4. Objdump-h Hello

5, Objcopy

6. Ranlib Library Index Generator: nm-s libmy.a

7. Size

8. Strings string peep: Strings Hello

9, strip program file slimming device.


Reference: Professional embedded software development Levin.

Binutils tool Set, software development weapon

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.