Why is the ELF execution entry point virtual address of the form 0x80xxxxx and not zero 0x0? -


When executed, the program will start running from the virtual address 0x80482c0. This address does not point to our main () process, but for a process called _start that is created by the linker.

My Google Research So far, I had some unclear historical speculations like this:

There is a folklore that 0x08048000 was once STACK_TOP (i.e., 0x08048000 on a port Got pushed down by a pile) * Nix to i386, which was promulgated by a group of Santa Cruz, California. This was when 128 MB of RAM was expensive, and 4 GB RAM was impossible.

Can anyone confirm / reject this?

As parents say, to capture more access through tap signals, systems like Unix Zero creates a page on the "unmapped" address Thus, a CPU accesses instantly, in other words, a segfault. This application is much better than letting go the badass. Exception vector tables, however, can be at least at any address on x86 processor (this is a special register, loaded with lidt opcode.)

Point Address is a part of the conventions that describes how memory has been kept, when it produces an executable binary, then these conventions should be known, so they are unlikely to change. Originally, for Linux, memory layout conventions have been inherited from earlier versions of Linux in the early 90's. One area of ​​access to a process should be:

  • The code should be within a range that includes the starting point.
  • Must have a stack.
  • should be a heap, in which there is a limit which increases with brk () and sbrk () system call.

Nowadays, some rooms for the heap, where malloc () goes, mmap () The system call is supported by the MMAP () call, which receives the volume of memory at the address that fits the kernel, but in the olden times, Linux like systems like the previous Unix , And its stack needed a large area in an uninterrupted section, which could move towards a growing address. Whatever was in the conference, he had to find the code and stack towards the lower address and after every point of the pile he had to give each part of the address space.

But there is also a stack, which is usually quite small but can grow quite dramatically in some occasions. The stack grows down, and when the stack is complete, we really want to crash the forecast rather than overwriting some data. Therefore there should be a wide area for the stack, as well as an unmanned page at the lower end of that area. And take some more! To capture zero pointers directives, the address is an unmissed page on zero. Therefore it was defined that except for the first page, the stack would get the first 128 MB address space. This means that the code should go after 128 MB, which is at an address similar to 0x080xxxxx.

As Michael describes, there was no major deal of "losing" the address of 128 MB because the location was very much in the context of what could really be used at that time, the Linux kernel 1GB was limiting the address space for the same process; the maximum allowed by the hardware was 4 GB, and it was not considered a major problem.


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -