Path: utzoo!attcan!uunet!dino!ux1.cso.uiuc.edu!castor.csg.uiuc.edu!long From: long@castor.csg.uiuc.edu (Junsheng Long) Newsgroups: comp.unix.questions Subject: Help needed: Data segment layout Message-ID: <1990Mar5.164340.7087@ux1.cso.uiuc.edu> Date: 5 Mar 90 16:43:40 GMT References: <5090.25e135aa@mva.cs.liv.ac.uk> <22@ctbilbo.UUCP> <666@mwtech.UUCP> Sender: news@ux1.cso.uiuc.edu (News) Reply-To: long@castor.csg.uiuc.edu.UUCP (Junsheng Long) Organization: Univ of Illinois at Urbana-Champaign Lines: 23 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