u-boot.lds 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. . = 0x387c0000; /* Where bootcode in the flash is mapped */
  29. .text : { *(.text); }
  30. . = ALIGN(4);
  31. .rodata : { *(.rodata) *(.rodata.str1.1) *(.rodata.str1.32) }
  32. . = 0x400000; /* Ram data segment to use */
  33. _i386boot_romdata_dest = ABSOLUTE(.);
  34. .data : AT ( LOADADDR(.rodata) + SIZEOF(.rodata) ) { *(.data) }
  35. _i386boot_romdata_start = LOADADDR(.data);
  36. . = ALIGN(4);
  37. .got : AT ( LOADADDR(.data) + SIZEOF(.data) ) { *(.got) }
  38. _i386boot_romdata_size = SIZEOF(.data) + SIZEOF(.got);
  39. . = ALIGN(4);
  40. _i386boot_bss_start = ABSOLUTE(.);
  41. .bss (NOLOAD) : { *(.bss) . = ALIGN(4); }
  42. _i386boot_bss_size = SIZEOF(.bss);
  43. /* 16bit realmode trampoline code */
  44. .realmode 0x7c0 : AT ( LOADADDR(.got) + SIZEOF(.got) ) { *(.realmode) }
  45. _i386boot_realmode = LOADADDR(.realmode);
  46. _i386boot_realmode_size = SIZEOF(.realmode);
  47. /* 16bit BIOS emulation code (just enough to boot Linux) */
  48. .bios 0 : AT ( LOADADDR(.realmode) + SIZEOF(.realmode) ) { *(.bios) }
  49. _i386boot_bios = LOADADDR(.bios);
  50. _i386boot_bios_size = SIZEOF(.bios);
  51. . = .;
  52. __u_boot_cmd_start = .;
  53. .u_boot_cmd : { *(.u_boot_cmd) }
  54. __u_boot_cmd_end = .;
  55. /* The load addresses below assumes that the flash
  56. * will be mapped so that 0x387f0000 == 0xffff0000
  57. * at reset time
  58. *
  59. * The fe00 and ff00 offsets of the start32 and start16
  60. * segments are arbitrary, the just have to be mapped
  61. * at reset and the code have to fit.
  62. * The fff0 offset of resetvec is important, however.
  63. */
  64. . = 0xfffffe00;
  65. .start32 : AT (0x387ffe00) { *(.start32); }
  66. . = 0xff00;
  67. .start16 : AT (0x387fff00) { *(.start16); }
  68. . = 0xfff0;
  69. .resetvec : AT (0x387ffff0) { *(.resetvec); }
  70. _i386boot_end = (LOADADDR(.resetvec) + SIZEOF(.resetvec) );
  71. }