|
|
extern end, _end; extern etext, _etext; extern edata, _edata;
These names refer neither to routines nor to locations with interesting contents. The address of etext is the first address above the program text, edata above the initialized data region, and end above the uninitialized data region. Those symbols whose names start with a underscore (_) are equivalent to the ones without the leading underscore. The only difference is that the symbols etext, edata, and end are not defined in any one of the following strictly standard conforming APIs: ANSI (cc -a ansi), POSIX (cc -a posix), and XPG4 (cc -a xpg4).
When execution begins, the program break
(the first location beyond the data)
coincides with end,
but the program break may be reset by the routines of
brk(S),
malloc(S),
standard input/output
stdio(S),
the profile (-p)
option of
cc(CP),
and so on.
Thus, the current value of the program break
should be determined by sbrk ((char )0).
See
brk(S).