From owner-freebsd-current Tue Sep 1 19:03:20 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id TAA13376 for freebsd-current-outgoing; Tue, 1 Sep 1998 19:03:20 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from dingo.cdrom.com (dingo.cdrom.com [204.216.28.145]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id TAA13363 for ; Tue, 1 Sep 1998 19:03:17 -0700 (PDT) (envelope-from mike@dingo.cdrom.com) Received: from dingo.cdrom.com (localhost.cdrom.com [127.0.0.1]) by dingo.cdrom.com (8.9.1/8.8.8) with ESMTP id SAA02773; Tue, 1 Sep 1998 18:59:46 GMT (envelope-from mike@dingo.cdrom.com) Message-Id: <199809011859.SAA02773@dingo.cdrom.com> X-Mailer: exmh version 2.0.2 2/24/98 To: John Polstra cc: current@FreeBSD.ORG Subject: Re: ELF binaries size In-reply-to: Your message of "Tue, 01 Sep 1998 18:49:49 MST." <199809020149.SAA16932@austin.polstra.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 01 Sep 1998 18:59:45 +0000 From: Mike Smith Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > > I don't understand what you're getting at. A program has to be able > > > to write its data. That's where the variables are. > > > > dingo:/tmp>cat a.c > > char *foo = "test"; > > int bar; > > void main(void) > > { > > foo[0] = 0; > > } > > dingo:/tmp>./a.out > > Bus error (core dumped) > ... > > As you can see, 'foo' is in the data segment, and it's pretty > > clearly read-only. > > No, foo is writable. What foo points to is read-only. Foo is in > the data segment, but what it points to is in the text segment. Oops, you're quite right. Where's that pointy hat? 8( -- \\ Sometimes you're ahead, \\ Mike Smith \\ sometimes you're behind. \\ mike@smith.net.au \\ The race is long, and in the \\ msmith@freebsd.org \\ end it's only with yourself. \\ msmith@cdrom.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message