Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Nov 1996 20:01:11 +1100
From:      Bruce Evans <bde@zeta.org.au>
To:        dkelly@hiwaay.net, freebsd-current@FreeBSD.org
Subject:   Re: More 3.0-current manpage oddities
Message-ID:  <199611210901.UAA10986@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>In "man 3 end"
>[snip]
>DESCRIPTION
>     The global variables end, extext and edata correspond to the the
>                                ^-- extra "x" (?)
>Meanwhile I still don't understand what end, etext, and edata contain.

They are addresses, not variables.  They can't quite be declared in C,
but the declarations in the man page are worse than necessary -
`extern foo;' means `extern int foo;' but there are no ints involved.
The declarations should be:

	extern void etext();	/* or maybe extern char etext[]; */
	extern char edata[];
	extern char end[];

These labels are intialized at link time by ld(1).  They don't have
much to do with brk(2) or malloc(3).  Some pointers for brk() and
sbrk() are initialized to `end'.

The HISTORY section says that the `end' _manual_ appeared in V6.

>gdb reports end is an int function.

This is wrong too.  etext is sort of an int function because it is in
the text section, but `end' is in the data section.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199611210901.UAA10986>