u-boot.lds 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. #include <config.h>
  24. OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
  25. OUTPUT_ARCH(i386)
  26. ENTRY(_start)
  27. SECTIONS
  28. {
  29. . = CONFIG_SYS_TEXT_BASE; /* Location of bootcode in flash */
  30. __text_start = .;
  31. .text : { *(.text*); }
  32. . = ALIGN(4);
  33. __u_boot_cmd_start = .;
  34. .u_boot_cmd : { *(.u_boot_cmd) }
  35. . = ALIGN(4);
  36. __u_boot_cmd_end = .;
  37. . = ALIGN(4);
  38. .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
  39. . = ALIGN(4);
  40. .data : { *(.data*) }
  41. . = ALIGN(4);
  42. .dynsym : { *(.dynsym*) }
  43. . = ALIGN(4);
  44. .hash : { *(.hash*) }
  45. . = ALIGN(4);
  46. .got : { *(.got*) }
  47. . = ALIGN(4);
  48. __data_end = .;
  49. . = ALIGN(4);
  50. __bss_start = ABSOLUTE(.);
  51. .bss (NOLOAD) : { *(.bss) }
  52. . = ALIGN(4);
  53. __bss_end = ABSOLUTE(.);
  54. . = ALIGN(4);
  55. __rel_dyn_start = .;
  56. .rel.dyn : { *(.rel.dyn) }
  57. __rel_dyn_end = .;
  58. /DISCARD/ : { *(.dynstr*) }
  59. /DISCARD/ : { *(.dynamic*) }
  60. /DISCARD/ : { *(.plt*) }
  61. /DISCARD/ : { *(.interp*) }
  62. /DISCARD/ : { *(.gnu*) }
  63. /* 16bit realmode trampoline code */
  64. .realmode REALMODE_BASE : AT ( LOADADDR(.rel.dyn) + SIZEOF(.rel.dyn) ) { KEEP(*(.realmode)) }
  65. __realmode_start = LOADADDR(.realmode);
  66. __realmode_size = SIZEOF(.realmode);
  67. /* 16bit BIOS emulation code (just enough to boot Linux) */
  68. .bios 0 : AT ( LOADADDR(.realmode) + SIZEOF(.realmode) ) { KEEP(*(.bios)) }
  69. __bios_start = LOADADDR(.bios);
  70. __bios_size = SIZEOF(.bios);
  71. /*
  72. * The following expressions place the 16-bit Real-Mode code and
  73. * Reset Vector at the end of the Flash ROM
  74. */
  75. . = START_16;
  76. .start16 : AT (CONFIG_SYS_TEXT_BASE + (CONFIG_SYS_MONITOR_LEN - RESET_SEG_SIZE + START_16)) { KEEP(*(.start16)); }
  77. . = RESET_VEC_LOC;
  78. .resetvec : AT (CONFIG_SYS_TEXT_BASE + (CONFIG_SYS_MONITOR_LEN - RESET_SEG_SIZE + RESET_VEC_LOC)) { KEEP(*(.resetvec)); }
  79. }