开发者

Memory layout of executable

开发者 https://www.devze.com 2023-02-05 12:12 出处:网络
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 libr

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消