Embedded Design Handbook

ID 683689
Date 8/28/2023
Public
Document Table of Contents

4.1.6.3.1. nios2-elf-readelf Usage Example

To display information about all instances of a specific function name in your .elf file, perform the following steps:

  1. Open a Nios® II command shell.
  2. In the command shell, type the following command:
    nios2-elf-readelf -symbols <project>.elf | grep <function name>

Search for the http_read_line Function Using nios2-elf-readelf

$ nios2-elf-readelf.exe –s my_file.elf | grep http_read_line
1106: 01001168 160 FUNC GLOBAL DEFAULT 3 http_read_line
Table 15.  Interpretation of nios2-elf-readelf Command Response
Value Description
1106 Symbol instance number
0100168 Memory address, in hexadecimal format
160 Size of this symbol, in bytes
FUNC Type of this symbol (function)
GLOBAL Binding (values: GLOBAL, LOCAL, and WEAK)
DEFAULT Visibility (values: DEFAULT, INTERNAL, HIDDEN, and PROTECTED)
3 Index
http_read_line Symbol name

You can obtain further information about the ELF file format online. Each of the ELF utilities has its own main page.