KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I made two C programs which were exact copy of each other. Compiled them on Linux using GCC compiler and obtained two separate executables. Then I examined the assembly code of both using objdump and found the instructions to be identical. Even the addresses of corresponding instructions in two files were the same. The program was to print the address of a variable in it. The programs when run produce different address and moreover the same program produces a different address when run each time. Why address of code lines is same in the two programs but the address of variable changes even for the same program each time it is run? I suspect that address printed on screen may be a virtual address, but if it's virtual why it can't be same each time? Is the address shown in Assembly code obtained by objdump is also virtual?
Tags (comma-separated)
Save Edits
Cancel