What are the meanings of the columns of the symbol table displayed by readelf?

后端 未结 4 978
情歌与酒
情歌与酒 2020-12-23 03:16

Could someone explain the columns shown of the symbol table using readelf?

4条回答
  •  庸人自扰
    2020-12-23 04:01

    Ok this question is old, but good old Google yields it if you are looking for readelf symboltable and NDX;

    Here is what I found out:

    The C code compiled with avr-gcc:

    int XYZ = 123;
    int ABC;
    

    when the generated elf file is analyzed using

    readelf --symbols KoreOS.elf
    

    you get as output:

    Num:    Value  Size Type    Bind   Vis      Ndx Name
    ...
    148: 0080200b     2 OBJECT  GLOBAL DEFAULT    2 XYZ
    ...
    258: 00803878     2 OBJECT  GLOBAL DEFAULT    3 ABC
    ...
    

    I use the NDX column as hint if the variable is initialized or not. But I found no documentation anywhere so I'm just guessing.

    greetings, Dominik

提交回复
热议问题