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