I am testing some 64-bit ELF binaries on x86/Linux.
apache server using gcc, with its default configuration (optimization level O2 I guess).
I stripped the
httpd binary with
strip command, and I use this command to check the
exported variables inside the
httpd ELF binary. For example, for the variable
readelf -s httpd | grep ap_hack_ap_hook_get_open_
To my surprise, I found two definitions of variable
ap_hack_ap_hook_get_open_. As shown below:
1732: 000000000068ff88 8 OBJECT GLOBAL DEFAULT 24 ap_hack_ap_hook_get_open_ 2263: 000000000068ff10 8 OBJECT GLOBAL DEFAULT 24 ap_hack_ap_hook_get_open_
Note that they have different memory addresses, which means they reside in different places in the
Could anyone give me some explanation about why there can exist two variables with same name, but different addresses?