1 .\" Copyright (c) 2008, Linux Foundation, written by by Michael Kerrisk
2 .\" <mtk.manpages@gmail.com>
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date. The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein. The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
25 .TH END 3 2008-07-17 "GNU" "Linux Programmer's Manual"
27 etext, edata, end \- end of program segments
35 The addresses of these symbols indicate the end of various program
39 This is the first address past the end of the text segment
43 This is the first address past the end of the
44 initialized data segment.
47 This is the first address past the end of the
48 uninitialized data segment (also known as the BSS segment).
50 Although these symbols have long been provided on most UNIX systems,
51 they are not standardized; use with caution.
53 The program must explicitly declare these symbols;
54 they are not defined in any header file.
56 On some systems the names of these symbols are preceded by underscores,
62 These symbols are also defined for programs compiled on Linux.
64 At the start of program execution,
65 the program break will be somewhere near
67 (perhaps at the start of the following page).
68 However, the break will change as memory is allocated via
74 with an argument of zero to find the current value of the program break.
76 When run, the program below produces output such as the following:
82 program text (etext) 0x8048568
83 initialized data (edata) 0x804a01c
84 uninitialized data (end) 0x804a024
93 extern char etext, edata, end; /* The symbols must have some type,
94 or "gcc \-Wall" complains */
97 main(int argc, char *argv[])
99 printf("First address past:\\n");
100 printf(" program text (etext) %10p\\n", &etext);
101 printf(" initialized data (edata) %10p\\n", &edata);
102 printf(" uninitialized data (end) %10p\\n", &end);