I am working on Ubuntu 14.04 LTS.
I have an executable file exec
compiled from file.c
. The file.c
makes use of functions from a static library. For example, let's says that fubar()
is a function of the static library that is used in file.c
.
This is something that I have noticed.
nm exec | grep fubar
gives a certain value.
(on my system and for my executable,0808377f
)gdb ./exec
and thenbreak fubar
gives a different value.
(on my system and for my executable,0x8083785
)
When I do a similar thing for another executable file (exec1
compiled from file1.c
, it outputs the same value for both the commands).
Both the commands are supposed to output the same virtual address. Aren't they? I am obviously missing something. Can someone explain what exactly is happening? And what is the difference between both the commands.