linker.ld 859 B

1234567891011121314151617181920212223242526272829303132333435
  1. /* Tell the linker that we want the symbol _start to be our entry point */
  2. ENTRY(_start)
  3. SECTIONS
  4. {
  5. /* We wanna be placed in the higher half, 2MiB above 0 in physical memory. */
  6. /* Since we are going to use PIE, this is just the base load address, but the */
  7. /* bootloader will be able to relocate us as it sees fit. */
  8. . = 0xffffffff80200000;
  9. /* We place the .stivale2hdr section containing the header in its own section, */
  10. /* and we use the KEEP directive on it to make sure it doesn't get discarded. */
  11. .stivale2hdr : {
  12. KEEP(*(.stivale2hdr))
  13. }
  14. /* Then let's place all the other traditional executable sections afterwards. */
  15. .text : {
  16. *(.text*)
  17. }
  18. .rodata : {
  19. *(.rodata*)
  20. }
  21. .data : {
  22. *(.data*)
  23. }
  24. .bss : {
  25. *(COMMON)
  26. *(.bss*)
  27. }
  28. }