Sunday, February 23, 2014

[OSDI] Memory Layout




  1. Text Segment
    • code (plain text), contains executable instructions
    • place below the heap or stack in order to prevent heaps and stack overflows from overwriting it.
    • sharable and readonly
      • may be accessed by editor, compiler, shell, etc.
  2. Initialized Data Segment
    • global variables and static variables
    • not read-only
      • initialized read-only area (ex. s[] = "hello world")
      • initialized read-write area (ex. const char *string = "hello world")
  3. Uninitialzed Data Segment
    • bss section: block started by symbol
    • global variables and static variables that are initialized to zero or do not have explicit initialization in source code
    • ex.
      • static int i;
      • [global] int j;
  4. Stack
  5. Heap
    • dynamic memory allocation


No comments:

Post a Comment