u-boot.lds 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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. . = 0x06000000; /* Location of bootcode in flash */
  29. _i386boot_text_start = .;
  30. .text : { *(.text); }
  31. . = ALIGN(4);
  32. .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
  33. _i386boot_text_size = SIZEOF(.text) + SIZEOF(.rodata);
  34. . = ALIGN(4);
  35. .data : { *(.data) }
  36. . = ALIGN(4);
  37. .interp : { *(.interp) }
  38. . = ALIGN(4);
  39. .dynsym : { *(.dynsym) }
  40. . = ALIGN(4);
  41. .dynstr : { *(.dynstr) }
  42. . = ALIGN(4);
  43. .hash : { *(.hash) }
  44. . = ALIGN(4);
  45. .got : { *(.got) }
  46. . = ALIGN(4);
  47. .got.plt : { *(.got.plt) }
  48. . = ALIGN(4);
  49. .dynamic (NOLOAD) : { *(.dynamic) }
  50. . = ALIGN(4);
  51. __u_boot_cmd_start = .;
  52. .u_boot_cmd : { *(.u_boot_cmd) }
  53. . = ALIGN(4);
  54. __u_boot_cmd_end = .;
  55. _i386boot_cmd_start = LOADADDR(.u_boot_cmd);
  56. _i386boot_rel_dyn_start = .;
  57. .rel.dyn : { *(.rel.dyn) }
  58. _i386boot_rel_dyn_end = .;
  59. . = ALIGN(4);
  60. _i386boot_bss_start = ABSOLUTE(.);
  61. .bss (NOLOAD) : { *(.bss) }
  62. _i386boot_bss_size = SIZEOF(.bss);
  63. /* 16bit realmode trampoline code */
  64. .realmode 0x7c0 : AT ( LOADADDR(.rel.dyn) + SIZEOF(.rel.dyn) ) { *(.realmode) }
  65. _i386boot_realmode = LOADADDR(.realmode);
  66. _i386boot_realmode_size = SIZEOF(.realmode);
  67. /* 16bit BIOS emulation code (just enough to boot Linux) */
  68. .bios 0 : AT ( LOADADDR(.realmode) + SIZEOF(.realmode) ) { *(.bios) }
  69. _i386boot_bios = LOADADDR(.bios);
  70. _i386boot_bios_size = SIZEOF(.bios);
  71. /* The load addresses below assumes that the flash
  72. * will be mapped so that 0x387f0000 == 0xffff0000
  73. * at reset time
  74. *
  75. * The fe00 and ff00 offsets of the start32 and start16
  76. * segments are arbitrary, the just have to be mapped
  77. * at reset and the code have to fit.
  78. * The fff0 offset of resetvec is important, however.
  79. */
  80. . = 0xfffffe00;
  81. .start32 : AT (0x0603fe00) { *(.start32); }
  82. . = 0xf800;
  83. .start16 : AT (0x0603f800) { *(.start16); }
  84. . = 0xfff0;
  85. .resetvec : AT (0x0603fff0) { *(.resetvec); }
  86. _i386boot_end = (LOADADDR(.resetvec) + SIZEOF(.resetvec) );
  87. }