Re: is not 0x8048000 too wasteful?--about virtual address layout



Sean wrote:
Linux running on x86, the virtual memory looks as following---the
address under 0x8048000 is totally wasted. ...

There is folklore that 0x08048000 once was STACK_TOP (that is, the stack
grew downwards from near 0x08048000 towards 0) on a port of *NIX to i386
that was promulgated by a group from Santa Cruz, California. This was
when 128MB of RAM was expensive, and 4GB of RAM was unthinkable.

Today, addresses from 0x00111000 to 0x08046fff often are occupied
by shared libraries instantiated at random addresses [the better
to deter malware], selected either by the kernel or by prelink.
Those who fret about contiguous address space and large arrays
often get little sympathy because x86_64 machines are so inexpensive
in the "first world." In any case, if it really matters then the
address layout can be controlled by a custom linker script during
the building the application. Various runtime hacks are available,
too. See http://BitWagon.com/tub/tub.html for one of them.

--
.