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 .\" Japanese Version Copyright (c) 2008 Akihiro MOTOKI
26 .\" all rights reserved.
27 .\" Translated 2008-08-21, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v3.05
29 .TH END 3 2008-07-17 "GNU" "Linux Programmer's Manual"
31 etext, edata, end \- プログラムセグメントの終わり
39 これらのシンボルのアドレスは各種のプログラムセグメントの終わりを示す。
42 テキストセグメント (プログラムのコード) の末尾の次のアドレス。
45 初期化されたデータのセグメントの末尾の次のアドレス。
48 初期化されていないデータのセグメント (BSS セグメントとも言われる)
51 これらのシンボルは長年ほとんどの UNIX システムで提供されているが、
54 プログラムではこれらのシンボルは明示的に宣言しなければならない。
55 これらはどのヘッダファイルでも定義されていない。
57 いくつかのシステムでは、これらのシンボルの名前は前にアンダースコアが
63 Linux でコンパイルされたプログラムでは、
66 プログラムの実行開始時に、プログラム・ブレークは
68 の近くのどこか (おそらく次のページの先頭) になる。
73 でメモリが割り当てられるに連れて、プログラム・ブレークは変化していく。
76 を呼び出すことで、プログラム・ブレークの現在値を知ることができる。
78 下記のプログラムを実行すると、次のような出力が得られる。
84 program text (etext) 0x8048568
85 initialized data (edata) 0x804a01c
86 uninitialized data (end) 0x804a024
95 extern char etext, edata, end; /* The symbols must have some type,
96 or "gcc \-Wall" complains */
99 main(int argc, char *argv[])
101 printf("First address past:\\n");
102 printf(" program text (etext) %10p\\n", &etext);
103 printf(" initialized data (edata) %10p\\n", &edata);
104 printf(" uninitialized data (end) %10p\\n", &end);