Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ edata(3C) — HP-UX 7.01

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

cc(1)

ld(1)

brk(2)

malloc(3C)

stdio(3S)

END(3C)

NAME

end, etext, edata − last locations in program

SYNOPSIS

extern _end;
extern end;
extern _etext;
extern etext;
extern _edata;
extern edata;

DESCRIPTION

These names refer neither to routines nor to locations with interesting contents.  The address of the symbols _etext and etext is the first address above the program text, the address of _edata and edata is the first address above the initialized data region, and the address of _end and end is the first address above the uninitialized data region. 

The linker defines these symbols with the appropriate values if they are referenced by the program but not defined.  The linker will issue an error if the user attempts to define _etext, _edata, or _end. 

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(2), malloc(3C), standard input/output (stdio(3S)), the profile (−p) option of cc(1), and so on. Thus, the current value of the program break should be determined by sbrk(0) (see brk(2)).

WARNINGS

In C, these names must look like addresses.  Thus, you would write &end instead of end to access the current value of end. 

SEE ALSO

cc(1), ld(1), brk(2), malloc(3C), stdio(3S). 

STANDARDS CONFORMANCE

end: XPG2

edata: XPG2

etext: XPG2

Hewlett-Packard Company  —  HP-UX Release 7.0: Sept 1989

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026