In article <Pine.SOL.4.21.0101111352290.24593-100000@jade>,
Zhiui Zhang <[EMAIL PROTECTED]> wrote:
>
> Thanks. It just occurs to me that Linux kernel used to have something
> like this in routine BUG():
>
> * ((char *) 0) = 0;
>
> It is called when there is a kernel bug. So address 0 should not be
> mapped writable, otherwise all C statements " char * p = NULL; * p =
> value; " would be legal.
Right. Address 0 is not mapped writable in FreeBSD.
> The book "Unix Internals - A Practical Approach" by S.D. Pate has a
> figure showing in ELF format, the stack lies BELOW the code segment
> and grows downwards. This might have something to do with code
> starting from 0x8048000.
Yes, I think you are right, now that my memory is returning. :-) In
SVR4 the stack grew downwards from 0x8000000. I think that libc and
the dynamic linker (all together in one shared library) were mapped
between 0x8000000 and 0x8048000. But that is just a guess. Most
modern libcs wouldn't fit in that amount of space these days.
John
--
John Polstra [EMAIL PROTECTED]
John D. Polstra & Co., Inc. Seattle, Washington USA
"Disappointment is a good sign of basic intelligence." -- Chögyam Trungpa
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message