首页 > 为什么linux中.text 虚拟内存段不是从0起始的?

为什么linux中.text 虚拟内存段不是从0起始的?

另外,为什么.text段对于32bit/64bit体系分别起始于0x08048000/0x00400000, 关于这个确定数值的取值有什么决定因素?


From the Linkers and loaders book:

On 386 systems, the text base address is 0x08048000, which permits a reasonably large stack below the text while still staying above address 0x08000000, permitting most programs to use a single second-level page table. (Recall that on the 386, each second-level table maps 0x00400000 addresses.)


据我所知,这个数字没什么特殊含义,这个数值就是大佬们拍脑袋定的。
文档里说:虚拟内存不从0开始是为了可以预留一个足够大的read only堆,每个程序都可以在这里建立单独的2级页表。一个2级页表是0x00400000

【热门文章】
【热门文章】