LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   linux nm tool (https://www.linuxquestions.org/questions/linux-general-1/linux-nm-tool-4175451865/)

rangi-vivek 02-27-2013 02:58 AM

linux nm tool
 
Hi!
I am using linux nm tool to analyse functions inside a linux ELF executable. The command I am using is "nm -l <executable name>". But the command does not show file name and path for some C/C++ functions. It does not happen in all cases and it shows currect file names and paths for the rest of the functions. I am using latest version of nm. Any idea or fix to this problem.
Regards,
Vivek

knudfl 02-27-2013 04:51 AM

Welcome to LQ.

$ man nm ( http://unixhelp.ed.ac.uk/CGI/man-cgi?nm )
-l : If line number information can be found,
print it after the other symbol information.

I.e. no such information, unless the code is compiled with [ -g ] :
http://www.network-theory.co.uk/docs...cintro_37.html
"" § 5. Normally, an executable file does not contain any references
to the original program source code ...
... GCC provides the -g debug option to store additional
debugging information in object files and executables. ""

-


All times are GMT -5. The time now is 11:58 PM.