u-boot.lds 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. /*
  2. * Copyright 2007-2009 Freescale Semiconductor, Inc.
  3. *
  4. * See file CREDITS for list of people who contributed to this
  5. * project.
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License as
  9. * published by the Free Software Foundation; either version 2 of
  10. * the License, or (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  20. * MA 02111-1307 USA
  21. */
  22. #ifndef RESET_VECTOR_ADDRESS
  23. #define RESET_VECTOR_ADDRESS 0xfffffffc
  24. #endif
  25. OUTPUT_ARCH(powerpc)
  26. /* Do we need any of these for elf?
  27. __DYNAMIC = 0; */
  28. PHDRS
  29. {
  30. text PT_LOAD;
  31. bss PT_LOAD;
  32. }
  33. SECTIONS
  34. {
  35. /* Read-only sections, merged into text segment: */
  36. . = + SIZEOF_HEADERS;
  37. .interp : { *(.interp) }
  38. .hash : { *(.hash) }
  39. .dynsym : { *(.dynsym) }
  40. .dynstr : { *(.dynstr) }
  41. .rel.text : { *(.rel.text) }
  42. .rela.text : { *(.rela.text) }
  43. .rel.data : { *(.rel.data) }
  44. .rela.data : { *(.rela.data) }
  45. .rel.rodata : { *(.rel.rodata) }
  46. .rela.rodata : { *(.rela.rodata) }
  47. .rel.got : { *(.rel.got) }
  48. .rela.got : { *(.rela.got) }
  49. .rel.ctors : { *(.rel.ctors) }
  50. .rela.ctors : { *(.rela.ctors) }
  51. .rel.dtors : { *(.rel.dtors) }
  52. .rela.dtors : { *(.rela.dtors) }
  53. .rel.bss : { *(.rel.bss) }
  54. .rela.bss : { *(.rela.bss) }
  55. .rel.plt : { *(.rel.plt) }
  56. .rela.plt : { *(.rela.plt) }
  57. .init : { *(.init) }
  58. .plt : { *(.plt) }
  59. .text :
  60. {
  61. *(.text)
  62. *(.got1)
  63. } :text
  64. _etext = .;
  65. PROVIDE (etext = .);
  66. .rodata :
  67. {
  68. *(.eh_frame)
  69. *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
  70. } :text
  71. .fini : { *(.fini) } =0
  72. .ctors : { *(.ctors) }
  73. .dtors : { *(.dtors) }
  74. /* Read-write section, merged into data segment: */
  75. . = (. + 0x00FF) & 0xFFFFFF00;
  76. _erotext = .;
  77. PROVIDE (erotext = .);
  78. .reloc :
  79. {
  80. *(.got)
  81. _GOT2_TABLE_ = .;
  82. *(.got2)
  83. _FIXUP_TABLE_ = .;
  84. *(.fixup)
  85. }
  86. __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
  87. __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
  88. .data :
  89. {
  90. *(.data)
  91. *(.data1)
  92. *(.sdata)
  93. *(.sdata2)
  94. *(.dynamic)
  95. CONSTRUCTORS
  96. }
  97. _edata = .;
  98. PROVIDE (edata = .);
  99. . = .;
  100. __u_boot_cmd_start = .;
  101. .u_boot_cmd : { *(.u_boot_cmd) }
  102. __u_boot_cmd_end = .;
  103. . = .;
  104. __start___ex_table = .;
  105. __ex_table : { *(__ex_table) }
  106. __stop___ex_table = .;
  107. . = ALIGN(256);
  108. __init_begin = .;
  109. .text.init : { *(.text.init) }
  110. .data.init : { *(.data.init) }
  111. . = ALIGN(256);
  112. __init_end = .;
  113. .bootpg RESET_VECTOR_ADDRESS - 0xffc :
  114. {
  115. arch/powerpc/cpu/mpc85xx/start.o (.bootpg)
  116. } :text = 0xffff
  117. .resetvec RESET_VECTOR_ADDRESS :
  118. {
  119. *(.resetvec)
  120. } :text = 0xffff
  121. . = RESET_VECTOR_ADDRESS + 0x4;
  122. /*
  123. * Make sure that the bss segment isn't linked at 0x0, otherwise its
  124. * address won't be updated during relocation fixups. Note that
  125. * this is a temporary fix. Code to dynamically the fixup the bss
  126. * location will be added in the future. When the bss relocation
  127. * fixup code is present this workaround should be removed.
  128. */
  129. #if (RESET_VECTOR_ADDRESS == 0xfffffffc)
  130. . |= 0x10;
  131. #endif
  132. __bss_start = .;
  133. .bss (NOLOAD) :
  134. {
  135. *(.sbss) *(.scommon)
  136. *(.dynbss)
  137. *(.bss)
  138. *(COMMON)
  139. } :bss
  140. . = ALIGN(4);
  141. _end = . ;
  142. PROVIDE (end = .);
  143. }