The start address for loading executable code is determined by the ELF headers for the executable. For example:
/bin/ls
architecture: i386, flags 0x00000112:
EXEC_P, HAS_SYMS, D_PAGED
start address 0x08049bb0
There's nothing stopping an executable from specifying a different load address; for whatever reason the default linker settings put it there. You could override with a custom linker script.
By default, on linux/x86, you won't see low addresses below 0x08000000
used for much; although the kernel may use it if requested in a mmap
call, or if it runs out of room for mmaps. Additionally, there have been proposals to use addresses in the 0x00000000 - 0x01000000
range for library mappings, to make buffer overflows more difficult (by embedding a NUL byte to terminate strings).
0x08048000
thing completely by linking programs withDYNAMIC
flag, making their segments be allocated alongside.so
's. – Ruthi