Advertisement
lfed255-dev

ld-script.ld

May 11th, 2019
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. cat link.ld
  2. ENTRY(_loader)
  3. /*OUTPUT_FORMAT(pei-i386)
  4. OUTPUT_ARCH(i386:i386)*/
  5.  
  6. KERNEL_VIRTUAL_BASE = 0xC0000000;
  7.  
  8. SECTIONS {
  9. /* The multiboot data and code will exist in low memory
  10. starting at 0x100000 */
  11.  
  12. . = 0x00100000;
  13. .lowerhalf : {
  14. *(.lowerhalf)
  15. }
  16.  
  17. /* The kernel will live at 3GB + 1MB in the virtual
  18. address space, which will be mapped to 1MB in the
  19. physical address space. */
  20.  
  21. . += KERNEL_VIRTUAL_BASE;
  22. .text ALIGN(4096) : AT(ADDR(.text) - KERNEL_VIRTUAL_BASE) {
  23. *(.text*)
  24. }
  25.  
  26. .data ALIGN (4096) : AT(ADDR(.data) - KERNEL_VIRTUAL_BASE) {
  27. *(.data)
  28. *(.rdata*)
  29. *(.rodata*)
  30. }
  31.  
  32. .bss ALIGN (4096) : AT(ADDR(.bss) - KERNEL_VIRTUAL_BASE) {
  33. _sbss = .;
  34. *(COMMON)
  35. *(.bss)
  36. _ebss = .;
  37. }
  38. end = .; _end = .; __end = .;
  39.  
  40. /DISCARD/ : {
  41. *(.eh_frame);
  42. *(.comment*);
  43. }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement