0

This question does a great job explaining how to get the symbols (variables, functions, etc) of an elf file.

Now that I have the symbols I will like to know on what location (module) they are.

For example if I compile a program that consists of the files main.c, someFile.h and someFile.c . Also let's say that the main.c program contains the global variable int Counter. then how I be able to tell that variable Counter is located in main.c?

Community
  • 1
  • 1
Tono Nam
  • 34,064
  • 78
  • 298
  • 470
  • Compile the C files to their respective object files (without linking these object files together). If you were to inspect these object files you will get your answer. – dirkgently Jun 14 '12 at 18:10
  • most of the files depend on other files so compiling files individually might not be possible. – Tono Nam Jun 14 '12 at 18:31

1 Answers1

1

the Answer is in here. .

Community
  • 1
  • 1
Tono Nam
  • 34,064
  • 78
  • 298
  • 470