link.ld 696 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. ENTRY(start)
  2. PHDRS
  3. {
  4. /* PT_LOAD FLAGS (page table permissions) not necessary, as we perform
  5. legacy boot. Linker probably sets sensible defaults anyway. */
  6. kernel_rx PT_LOAD;
  7. kernel_rw PT_LOAD;
  8. kernel_ro PT_LOAD;
  9. }
  10. SECTIONS {
  11. /* Chainloader linked at 8M, payload at 16M */
  12. .text 16M : AT(16M) ALIGN(4K)
  13. {
  14. *(.multiboot2_header)
  15. *(.text .text.*)
  16. } : kernel_rx
  17. .rodata :
  18. {
  19. *(.rodata .rodata.*)
  20. } : kernel_ro
  21. .data :
  22. {
  23. *(.data .data.*)
  24. } : kernel_rw
  25. .bss :
  26. {
  27. *(COMMON)
  28. *(.bss .bss.*)
  29. } : kernel_rw
  30. /DISCARD/ :
  31. {
  32. *(.eh_frame .eh_frame*)
  33. }
  34. }