Back to home page

Quest Cross Reference

 
 

    


0001 OUTPUT_FORMAT("elf32-i386")
0002 OUTPUT_ARCH(i386)
0003 ENTRY(_start)
0004 PHDRS {
0005   physical PT_LOAD FILEHDR PHDRS;
0006   virtualtext PT_LOAD;
0007   virtualdata PT_LOAD;
0008   virtualtext16 PT_LOAD;
0009 }
0010 SECTIONS {
0011   /* Place per-CPU data in phantom segment, to be dynamically allocated */
0012   . = 0x0;
0013   _percpustart = .;
0014   .percpu (NOLOAD) : { *(.percpu) } : NONE
0015   _percpuend = ALIGN(0x1000);
0016   _percpu_pages_plus_one = (_percpuend - _percpustart) / 0x1000 + 1;
0017 
0018   /* Bootstrap physical section, at virtual and physical address 0x100000 */
0019   . = 0x100000 + SIZEOF_HEADERS;
0020   .physicaltext : {   boot/boot.o (.text) } : physical
0021   .physicalrodata : { boot/boot.o (.rodata) } : physical
0022   .physicaldata : {   boot/boot.o (.data) } : physical
0023   .physicalbss : {    boot/boot.o (.bss COMMON) } : physical
0024   _physicalkernelstart = ALIGN(0x1000);
0025   _bootstrap_pages = (_physicalkernelstart - 0x100000) / 0x1000;
0026 
0027   /* Permanent virtual section, at virtual address 0xFFC00000 */
0028   /* Maps kernel in upper 4MB of virtual address space on 32-bit machines */
0029   . = 0xFFC00000;
0030   _kernelstart = .;
0031   .text : AT ( _physicalkernelstart ) { *(.text) } : virtualtext
0032   . = ALIGN(32);
0033   .rodata : AT ( ( LOADADDR(.text) + SIZEOF(.text) + 31 ) & 0xFFFFFFE0 )
0034     { *(.rodata*) } : virtualtext
0035 
0036   . = ALIGN(32);
0037   /* Insert a read-only null-terminated array of pointers to constructors */
0038   _percpu_ctor_list = .;
0039   .ctors : AT ( ( LOADADDR (.rodata) + SIZEOF (.rodata) + 31 ) & 0xFFFFFFE0 )
0040               { *(.percpu.ctor); LONG(0) } : virtualtext
0041 
0042   . = ALIGN(32);
0043   /* Insert a read-only null-terminated array of pointers to modules */
0044   _module_ptr_list = .;
0045   .moduleptrs : AT ( ( LOADADDR (.ctors) + SIZEOF (.ctors) + 31 ) & 0xFFFFFFE0 )
0046                    { *(.module.ptrs); LONG(0) } : virtualtext
0047 
0048   . = ALIGN(0x1000);
0049    _kernel_readwrite = .;
0050   .data : AT ( ( LOADADDR(.moduleptrs) + SIZEOF(.moduleptrs) + 0xFFF ) & 0xFFFFF000 )
0051              { *(.data) } : virtualdata
0052 
0053   . = ALIGN(0x1000);
0054   .bss : AT ( ( LOADADDR(.data) + SIZEOF(.data) + 0xFFF ) & 0xFFFFF000 )
0055             { *(.bss) *(COMMON) } : virtualdata
0056   _kernelend = ALIGN(0x1000);
0057   _readwrite_pages = ( _kernelend - _kernel_readwrite ) / 0x1000;
0058   _readonly_pages = ( _kernel_readwrite - _kernelstart ) / 0x1000;
0059 
0060   /* .text16 contains real-mode code for use with vm86.  In this mode,
0061    * the CPU can only deal with virtual addresses below the 1MB mark.
0062    * Therefore, while the code is physically located after the .bss,
0063    * it is linked with virtual addresses starting at 0x8000.  The kernel
0064    * will setup the page-table mappings to support this. */
0065   . = 0x8000; _code16start = .; 
0066   _code16physicalstart = ( LOADADDR(.bss) + SIZEOF(.bss) + 0xFFF ) & 0xFFFFF000;
0067   .text16 : AT ( _code16physicalstart ) 
0068             { vm/code16.o (.text16) } : virtualtext16
0069   _code16end = ALIGN(0x1000);
0070   _code16_pages = ( _code16end - _code16start ) / 0x1000;
0071 
0072   . = ALIGN(0x1000);
0073   .eh_frame (NOLOAD) : AT ( _code16end )
0074                        { *(.eh_frame) } : NONE
0075 }