From owner-freebsd-current Thu Nov 21 01:07:17 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id BAA13578 for current-outgoing; Thu, 21 Nov 1996 01:07:17 -0800 (PST) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id BAA13569 for ; Thu, 21 Nov 1996 01:07:07 -0800 (PST) Received: (from bde@localhost) by godzilla.zeta.org.au (8.7.6/8.6.9) id UAA10986; Thu, 21 Nov 1996 20:01:11 +1100 Date: Thu, 21 Nov 1996 20:01:11 +1100 From: Bruce Evans Message-Id: <199611210901.UAA10986@godzilla.zeta.org.au> To: dkelly@hiwaay.net, freebsd-current@FreeBSD.org Subject: Re: More 3.0-current manpage oddities Sender: owner-current@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk >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