简体   繁体   中英

Memory Protection attributes

A typical process consists of 4 memory regions text, data, heap and stack. What protection attributes does each of them have ?

Thanks Josh

This varies between operating systems, so no generally valid answer is possible, but typically it looks like this:

  • text - read-execute
  • data - read
  • heap - read-write
  • stack - read-write

Older operating systems might have text and data writable (some hardware does not allow to distinguish between read and read-execute either). Also, some operating systems will let you change this at will, and others will not (or will have some restrictions, such as not letting you set something to "execute" that was "write" before).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM