Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 01 Sep 1998 18:59:45 +0000
From:      Mike Smith <mike@smith.net.au>
To:        John Polstra <jdp@polstra.com>
Cc:        current@FreeBSD.ORG
Subject:   Re: ELF binaries size 
Message-ID:  <199809011859.SAA02773@dingo.cdrom.com>
In-Reply-To: Your message of "Tue, 01 Sep 1998 18:49:49 MST." <199809020149.SAA16932@austin.polstra.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
> > > 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



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