/* * (C) Copyright 2002 * Daniel Engström, Omicron Ceti AB, daniel@omicron.se. * * See file CREDITS for list of people who contributed to this * project. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA */ OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386") OUTPUT_ARCH(i386) ENTRY(_start) SECTIONS { /* AMI's boot code copies 0xfff80000-0xfff9ffff to 0x40000-0x5ffff. It puts CS to 0x4000 and jumps to real mode at 0x40000 (= 0x4000:0000). Therefore, so as far as this script goes, it thinks LOADADDR starts at 0x40000. */ /* 16 bit */ /* Only the offset of IP here. CS=0x4000 */ . = 0x0000; .start16 : AT(0x40000) { *(.start16); } .realmode 0x7c0 : AT( LOADADDR(.start16) + SIZEOF(.start16) ) { *(.realmode) } /* check this */ _i386boot_realmode = LOADADDR(.realmode); _i386boot_realmode_size = SIZEOF(.realmode); .bios : AT ( LOADADDR(.realmode) + SIZEOF(.realmode) ) { *(.bios) } /* not needed ?*/ _i386boot_bios = LOADADDR(.bios); _i386boot_bios_size = SIZEOF(.bios); /* . = 0xfff0; */ /*check this*/ .reset : AT ( LOADADDR(.bios) + SIZEOF(.bios) ) { *(.reset); } _i386boot_end = (LOADADDR(.reset) + SIZEOF(.reset) ); /* 32 bit */ /* Assumption: ROM image above is < 4K. */ /* The VMA below has to matche the #define TEXTBASE in config.mk*/ . = 0x00041000; .text : { *(.text); } .rodata ALIGN(4) : { *(.rodata) *(.rodata.str1.1) *(.rodata.str1.32) } _i386boot_romdata_dest = ABSOLUTE(.); .data : { *(.data) } _i386boot_romdata_start = LOADADDR(.data); .got ALIGN(4) : { *(.got) } _i386boot_romdata_size = SIZEOF(.data) + SIZEOF(.got); __u_boot_cmd_start = .; .u_boot_cmd ALIGN(4) : { *(.u_boot_cmd) } __u_boot_cmd_end = .; .start32 ALIGN(4) : { *(.start32); } _i386boot_bss_start = ABSOLUTE(.); .bss ALIGN(4) : { * (.bss) } .atp_load_space ALIGN(0x10000) (NOLOAD) : {* (.atp_load_space)} _i386boot_bss_end = .; _i386boot_bss_size = _i386boot_bss_end - _i386boot_bss_start; }