link_descriptor.ld 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. OUTPUT_ARCH(arm)
  2. ENTRY(_start)
  3. romBase = 0x00201000;
  4. bss1Base = 0x00102000;
  5. bss2Base = 0x00267000;
  6. stackBase = 0x00200000;
  7. /* log_sram_buf + bss1 should be less than 40 KB.*/
  8. MEMORY {
  9. bss1 : ORIGIN = 0x00102000, LENGTH = 0xBC00
  10. rom : ORIGIN = 0x00201000, LENGTH = 0x3A000
  11. bss2 : ORIGIN = 0x00267000, LENGTH = 0x14000
  12. stack : ORIGIN = 0x00200000, LENGTH = 0xC00
  13. }
  14. SECTIONS {
  15. /* rom region */
  16. . = romBase;
  17. .start ALIGN(4) : {
  18. *(.text.start)
  19. }
  20. . = romBase + 0x01FC;
  21. .rom_info ALIGN(4) : {
  22. *(.data.rom_info)
  23. }
  24. .text ALIGN(4) : {
  25. *(.text)
  26. *(.text.*)
  27. }
  28. .rodata ALIGN(4) : {
  29. *(.rodata)
  30. *(.rodata.*)
  31. }
  32. .data ALIGN(4) : {
  33. *(.data)
  34. *(.data.*)
  35. }
  36. .got ALIGN(4) : {
  37. *(.got)
  38. *(.got.*)
  39. }
  40. __boot_end = .;
  41. /* stack region */
  42. . = stackBase;
  43. .stack ALIGN(4) : {
  44. _stack_start = .;
  45. *(.stack)
  46. _stack_end = .;
  47. }
  48. /* bss2 region */
  49. . = bss2Base;
  50. .bss2 ALIGN(16) : {
  51. _bss2_start = .;
  52. *(EXCLUDE_FILE(*dramc_*.o) .bss)
  53. *(EXCLUDE_FILE(*dramc_*.o) .bss.*)
  54. *(EXCLUDE_FILE(*dramc_*.o) COMMON)
  55. /* make _bss2_end as 4 bytes alignment */
  56. . = ALIGN(4);
  57. _bss2_end = .;
  58. }
  59. /* bss1 region */
  60. . = bss1Base;
  61. .bss1 ALIGN(16) : {
  62. _bss1_start = .;
  63. *print.o (.log_sram_buf)
  64. *efi.o (.gpt_sram_buf)
  65. *efi.o (.gpt_sram_crc32_table)
  66. *efi.o (.gpt_sram_part_info)
  67. *efi.o (.gpt_sram_part_meta_info)
  68. *(*dramc_*.o .bss)
  69. *(*dramc_*.o .bss.*)
  70. *(*dramc_*.o COMMON)
  71. /* make _bss1_end as 4 bytes alignment */
  72. . = ALIGN(4);
  73. _bss1_end = .;
  74. }
  75. }