You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
937 B

  1. ENTRY(start)
  2. SECTIONS {
  3. . = 1M; /* load the kernel at 1MiB above 0x0 */
  4. /* Merged section for both the multiboot header and .rodata,
  5. so we don't waste a page on the multiboot header */
  6. .rodata : {
  7. /* ensure the multiboot header is at the start of the binary */
  8. KEEP(*(.multiboot_header))
  9. /* ensure small fragments in .rodata and .rel.ro are linked together */
  10. *(.rodata .rodata.*)
  11. . = ALIGN(4K);
  12. }
  13. .text : {
  14. /* Kernel code */
  15. *(.text .text.*) /* .text.* ensures that all small .text fragments are linked together */
  16. . = ALIGN(4K);
  17. }
  18. .data : {
  19. *(.data .data.*)
  20. . = ALIGN(4K);
  21. }
  22. .bss : {
  23. *(.bss .bss.*)
  24. . = ALIGN(4K);
  25. }
  26. .got : {
  27. *(.got)
  28. . = ALIGN(4K);
  29. }
  30. .got.plt : {
  31. *(.got.plt)
  32. . = ALIGN(4K);
  33. }
  34. .data.rel.ro : ALIGN(4K) {
  35. *(.data.rel.ro.local*) *(.data.rel.ro .data.rel.ro.*)
  36. . = ALIGN(4K);
  37. }
  38. .gcc_except_table : ALIGN(4K) {
  39. *(.gcc_except_table)
  40. . = ALIGN(4K);
  41. }
  42. }