- 論壇徽章:
- 0
|
原帖由 bzw2000 于 2008-2-5 14:15 發(fā)表 ![]()
我用objdump -d 反匯編了一下, 看到最低地址的代碼(即init section)的地址不是從0x8048000開始的(而且地址不固定, 比如0x8048278或0x8048254等).
1. 請問一下, 從0x8048000到0x8048278(或0x8048254)中間的是 ...
1、2問題可以用info ld看到
`SIZEOF_HEADERS'
`sizeof_headers'
Return the size in bytes of the output file's headers. This is
information which appears at the start of the output file. You
can use this number when setting the start address of the first
section, if you choose, to facilitate paging.
When producing an ELF output file, if the linker script uses the
`SIZEOF_HEADERS' builtin function, the linker must compute the
number of program headers before it has determined all the section
addresses and sizes. If the linker later discovers that it needs
additional program headers, it will report an error `not enough
room for program headers'. To avoid this error, you must avoid
using the `SIZEOF_HEADERS' function, or you must rework your linker
script to avoid forcing the linker to use additional program
headers, or you must define the program headers yourself using the
`PHDRS' command (*note PHDRS: .
問題3嘛,曾經(jīng)看到過一個(gè)傳聞。0x8048000是unix移植到i386時(shí)的棧頂,當(dāng)時(shí)的棧從0x8048000到0x0。那個(gè)時(shí)候內(nèi)存還很貴,128M已經(jīng)是非常大的內(nèi)存了。后來如何改成程序的起始處就不得而知了。反正應(yīng)該是歷史原因,改成其它地址也會(huì)有人問為什么
128M的地址空間嘛,說有多浪費(fèi)也不見得,需要大地址空間就不用x86了。 |
|