What does “symbol value” from nm command mean?

后端 未结 3 706
梦谈多话
梦谈多话 2020-12-15 05:54

When you list the symbol table of a static library, like nm mylib.a, what does the 8 digit hex that show up next to each symbol mean? Is that the relative locat

3条回答
  •  鱼传尺愫
    2020-12-15 06:16

    The hex numeral is the memory offset into the object files where the symbol can be found. It's literally the number of bytes into the object code.

    That value is used by the linker to locate and make a copy of the symbol's value. You can see generally how it's laid out if you add the -S option to nm, which will show you the size of the value for each symbol.

提交回复
热议问题