When loading an executable then segments like the code, data, bss and so on need to be placed in memory. I am just wondering, if someone could tell me where on a standard x86 for example the libc library is placed. Is that at the top or bottom of memory. My guess is at the bottom, close to the applicat开发者_JAVA技巧ion code, ie., that would look something like this here:
--------- 0x1000
Stack
|
V
^
|
Heap
----------
Data + BSS
----------
App Code
----------
libc
---------- 0x0000
Thanks a lot, Ross
It depends on the whims of the loader.
In particular, on any modern system that uses ASLR, you can't predict where a particular library is going to end up.
精彩评论