LoginSignup
2
2

More than 5 years have passed since last update.

linux > readelf -s (Symbol table) > NDX: > Readelf identifies each section by an integer index (=Ndx).

Last updated at Posted at 2015-08-22
readelf -s Test.elf | less

Symbol table '.symtab' contains 12323 entries:
   Num:    Value  Size Type    Bind   Vis      Ndx Name
     0: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND 
     1: 00000bc0     0 NOTYPE  LOCAL  DEFAULT  ABS $m
     2: 00100000     0 NOTYPE  LOCAL  DEFAULT    4 $a
     3: 00100140     0 NOTYPE  LOCAL  DEFAULT    4 $d

上記で出てくるNdxはなにかというと以下の記載を見つけた。

what-are-the-meanings-of-the-columns-displayed-by-readelf @ SO

Readelf identifies each section by an integer index (=Ndx).

上記の例の場合、Name==$aの値を読むには Section No.==4を読むことになりそう。

以下のようなreadelf実行結果例もあり、Section No.==6は現在作業しているファイルではRAM rwに対応していた。

6202: 009c107c     4 OBJECT  LOCAL  DEFAULT    6 s_sramsize

つまりはs_sramsizeは読み書き可能なRAM領域に格納されているLOCAL変数であることが分かる。

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2