SHARE
TWEET

Untitled

a guest Feb 13th, 2017 166 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* The bootloader will look at this image and start execution at the symbol
  2.    designated as the entry point. */
  3. ENTRY(_istart)
  4.  
  5. /* Tell where the various sections of the object files will be put in the final
  6.    kernel image. */
  7. SECTIONS
  8. {
  9.     /* Begin putting sections at 1 MiB, a conventional place for kernels to be
  10.        loaded at by the bootloader. */
  11.     /*. = _INIT_BASE; */
  12.   . = 0x100000; /* results in a 1.1MB kernel */
  13.   /*. = 0x1000; *//* results in a 42KB kernel */
  14.  
  15.   _sinit = .;
  16.   .init.text ALIGN(4K) :
  17.   {
  18.     *(.init.text)
  19.   }
  20.  
  21.   .init.data ALIGN(4K) :
  22.   {
  23.     *(.init.data)
  24.   }
  25.  
  26.   .init.rodata ALIGN(4K) :
  27.   {
  28.     *(.init.rodata)
  29.   }
  30.  
  31.   .init.bss ALIGN(4K) :
  32.   {
  33.     *(.init.bss)
  34.   }
  35.   _einit = .;
  36.  
  37.   _KERN_BASE = 0xFFFFFFFF80000000; /* kernel should be at -2GB */
  38.   . = _KERN_BASE + _einit;
  39.     /* First put the multiboot header, as it is required to be put very early
  40.        early in the image or the bootloader won't recognize the file format.
  41.        Next we'll put the .text section. */
  42.     .text : AT(ADDR(.text) - _KERN_BASE) ALIGN(4K)
  43.     {
  44.         *(.text*)
  45.     }
  46.  
  47.     /* Read-only data. */
  48.     .rodata ALIGN(4K) :
  49.     {
  50.         *(.rodata*)
  51.     }
  52.  
  53.     /* Read-write data (initialized) */
  54.     .data ALIGN(4K) :
  55.     {
  56.         *(.data*)
  57.     }
  58.  
  59.     /* Read-write data (uninitialized) and stack */
  60.     .bss ALIGN(4K) :
  61.     {
  62.         *(COMMON)
  63.         *(.bss*)
  64.     }
  65.  
  66.     /* The compiler may produce other sections, by default it will put them in
  67.        a segment with the same name. Simply add stuff here as needed. */
  68. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top