kernel.ld 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. * Copyright (c) 2009 Corey Tabaka
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining
  5. * a copy of this software and associated documentation files
  6. * (the "Software"), to deal in the Software without restriction,
  7. * including without limitation the rights to use, copy, modify, merge,
  8. * publish, distribute, sublicense, and/or sell copies of the Software,
  9. * and to permit persons to whom the Software is furnished to do so,
  10. * subject to the following conditions:
  11. *
  12. * The above copyright notice and this permission notice shall be
  13. * included in all copies or substantial portions of the Software.
  14. *
  15. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  16. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  17. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  18. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  19. * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  20. * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  21. * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  22. */
  23. ENTRY(_start)
  24. SECTIONS
  25. {
  26. .text 0x0200000 : {
  27. *(.text)
  28. *(SORT(.text$*))
  29. *(.gnu.linkonce.t.*)
  30. __ctor_list = .;
  31. *(SORT(.ctor*))
  32. __ctor_end = .;
  33. __dtor_list = .;
  34. *(SORT(.dtor*))
  35. __dtor_end = .;
  36. . = ALIGN(4096);
  37. }
  38. __data_start = .;
  39. .data : { *(.data .data.* .gnu.linkonce.d.*) }
  40. .stab : { *(.stab) }
  41. .stabst : { *(.stabstr) }
  42. . = ALIGN(4096);
  43. __data_end = .;
  44. .rdata : {
  45. *(.rdata)
  46. *(SORT(.rdata$*))
  47. *(.rodata*)
  48. *(.gnu.linkonce.r.*)
  49. __commands_start = .;
  50. KEEP (*(.commands))
  51. __commands_end = .;
  52. . = ALIGN(4);
  53. __apps_start = .;
  54. KEEP (*(.apps))
  55. __apps_end = .;
  56. . = ALIGN(4096);
  57. }
  58. __bss_start = .;
  59. .bss : {
  60. *(.bss*)
  61. *(.gnu.linkonce.b.*)
  62. *(COMMON)
  63. . = ALIGN(4096);
  64. }
  65. __bss_end = .;
  66. /*. += 0x2000;
  67. _kstack = .;
  68. . += 0x1000;*/
  69. _end = .;
  70. /DISCARD/ : { *(.comment .note .eh_frame) }
  71. }