u-boot.lds 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /*
  2. * (C) Copyright 2002
  3. * Daniel Engström, Omicron Ceti AB, daniel@omicron.se.
  4. *
  5. * See file CREDITS for list of people who contributed to this
  6. * project.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License as
  10. * published by the Free Software Foundation; either version 2 of
  11. * the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  21. * MA 02111-1307 USA
  22. */
  23. OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
  24. OUTPUT_ARCH(i386)
  25. ENTRY(_start)
  26. SECTIONS
  27. {
  28. . = CONFIG_SYS_TEXT_BASE; /* Location of bootcode in flash */
  29. __text_start = .;
  30. .text : { *(.text*); }
  31. . = ALIGN(4);
  32. __u_boot_cmd_start = .;
  33. .u_boot_cmd : { *(.u_boot_cmd) }
  34. . = ALIGN(4);
  35. __u_boot_cmd_end = .;
  36. . = ALIGN(4);
  37. .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
  38. . = ALIGN(4);
  39. .data : { *(.data*) }
  40. . = ALIGN(4);
  41. .dynsym : { *(.dynsym*) }
  42. . = ALIGN(4);
  43. .hash : { *(.hash*) }
  44. . = ALIGN(4);
  45. .got : { *(.got*) }
  46. . = ALIGN(4);
  47. __data_end = .;
  48. . = ALIGN(4);
  49. __bss_start = ABSOLUTE(.);
  50. .bss (NOLOAD) : { *(.bss) }
  51. . = ALIGN(4);
  52. __bss_end = ABSOLUTE(.);
  53. . = ALIGN(4);
  54. __rel_dyn_start = .;
  55. .rel.dyn : { *(.rel.dyn) }
  56. __rel_dyn_end = .;
  57. /DISCARD/ : { *(.dynstr*) }
  58. /DISCARD/ : { *(.dynamic*) }
  59. /DISCARD/ : { *(.plt*) }
  60. /DISCARD/ : { *(.interp*) }
  61. /DISCARD/ : { *(.gnu*) }
  62. /* 16bit realmode trampoline code */
  63. .realmode 0x7c0 : AT ( LOADADDR(.rel.dyn) + SIZEOF(.rel.dyn) ) { KEEP(*(.realmode)) }
  64. __realmode_start = LOADADDR(.realmode);
  65. __realmode_size = SIZEOF(.realmode);
  66. /* 16bit BIOS emulation code (just enough to boot Linux) */
  67. .bios 0 : AT ( LOADADDR(.realmode) + SIZEOF(.realmode) ) { KEEP(*(.bios)) }
  68. __bios_start = LOADADDR(.bios);
  69. __bios_size = SIZEOF(.bios);
  70. /* The load addresses below assumes that the flash
  71. * will be mapped so that 0x387f0000 == 0xffff0000
  72. * at reset time
  73. *
  74. * The fe00 and ff00 offsets of the start32 and start16
  75. * segments are arbitrary, the just have to be mapped
  76. * at reset and the code have to fit.
  77. * The fff0 offset of resetvec is important, however.
  78. */
  79. . = 0xfffffe00;
  80. .start32 : AT (CONFIG_SYS_TEXT_BASE + 0x3fe00) { KEEP(*(.start32)); }
  81. . = 0xf800;
  82. .start16 : AT (CONFIG_SYS_TEXT_BASE + 0x3f800) { KEEP(*(.start16)); }
  83. . = 0xfff0;
  84. .resetvec : AT (CONFIG_SYS_TEXT_BASE + 0x3fff0) { KEEP(*(.resetvec)); }
  85. }