I can extract symbols using the "nm -a -D" command.
But is there a way to extract the symbol names with an offset from the start of the file?
For example,
nm -D ./libc.so
Shows me this -
...
00000000000f8c60 T xdr_wrapstring
00000000000f7cc0 T xencrypt
00000000000bd230 T __xmknod
00000000000bd2a0 T __xmknodat
000000000003ec70 T __xpg_basename
00000000000314b0 W __xpg_sigpause
0000000000080db0 T __xpg_strerror_r
00000000000f6090 T xprt_register
00000000000f61f0 T xprt_unregister
00000000000bd110 T __xstat
00000000000bd110 T __xstat64
Now, I want to get the offset of the symbol names from the start of the file in the same way that the "strings -t x" command shows the offset of the strings -
strings -t x ./libc.so | grep __xstat
13af9 __xstat
13fac __xstat64
How can I do this?
(I can't use the "strings" command on the output of the "nm" command because there could be multiple instances of the same symbol string in the file and I want to get the exact offset of the symbol (not just some string that is the same as the symbol))