1. Introduction
Readelf is used to display information about one or more object files in the elf format, and you can control which information is displayed by its options.
2. Parameter
-A--all displays all information, equivalent to-h-l-s-s-r-d-v-a-I.
-H--file-header Displays the file header information for the elf file to begin.
-L--program-headers--segments Displays the program header (segment header) information (if any).
-S--section-headers--sections Displays the section header information (if any).
-G--section-groups Displays section group information, if any.
-T--section-details displays the details of the section (-s).
-S--syms--symbols displays the items (if any) in the symbol table segment.
-e--headers Displays all header information, equivalent to:-h-l-S
-N--notes Displays the information for the note segment (kernel annotation).
-R--relocs Displays information about relocatable segments.
-U--unwind Displays unwind segment information. Only the unwind segment information of the IA64 Elf is currently supported.
-D--dynamic Displays information about the dynamic segment.
-V--version-info Displays the information for the version segment.
-A--arch-specific displays CPU architecture information.
-d--use-dynamic uses symbol tables in dynamic segments to display symbols instead of using symbol segments.
-X <number or name>--hex-dump=<number or name> displays the contents of the specified paragraph in 16-way. Number specifies the index in the middle of the section table, or the string specifies the name of the segment in the file.
-w[liaprmffsor] or--debug-dump[=line,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,= Ranges] Displays the contents specified in the Debug segment.
-I--histogram displays a histogram of the length of the bucket list when the symbol is displayed.
-V--version displays version information for readelf.
-H--help Displays the command line options supported by Readelf.
-W--wide wide row output.
@file can centralize options in one file and then use this @file option to load.
3, Example
1) display dynamic segment information
Readelf-d <file_name>
For example:
Readelf-d/BIN/RM
Dynamic section at offset 0x9420 contains entries:
Tag Type Name/value
0x0000000000000001 (NEEDED) Shared library: [libc.so.6]
0x000000000000000c (INIT) 0x401470
。。。。