Why do assembly programs have separate segments?

后端 未结 3 861
忘了有多久
忘了有多久 2021-02-09 09:25

Why do assembly programs load segments (.data/.bss and .text) into separate memory blocks instead of loading both the data and the code se

3条回答
  •  抹茶落季
    2021-02-09 09:58

    You can normally set attributes on a segment-by-segment basis. For example, a read-only segment lets you specify "read-only" once, and just put read-only data into that segment, rather than specifying read-only on a variable-by-variable basis.

提交回复
热议问题