Need Help on Data segment layout

long at uicsgva.csg.uiuc.edu long at uicsgva.csg.uiuc.edu
Sun Mar 18 11:37:04 AEST 1990



I would like to know the data segment layout of a C program
on Unix (Sun OS). For the following example, I found some extra 
variables were inserted before the first global variables 
(marked as ? in the following figure). 


/* --- example.c ---*/           +----------+
int a = 0;                       |  text    |
int b[32];                       +----------+ <- etext
                                 |    ?     |
main()                           +----------+
{                                |    a     |
...                              +----------+ <- edata
}                                |    b     |
                                 +----------+ <- end
                                 |          |

Now my questions are: does anyone know what they are? 
Does they vary from program to program?

Thank you very much.

junsheng long



More information about the Comp.unix.wizards mailing list