Example Makefile and linker script for building a run-from-flash
gzboot image for the IQ80310 with room for 2M of compressed data.
This commit is contained in:
parent
bc49a6eede
commit
a91d5a1a99
|
@ -0,0 +1,16 @@
|
|||
# $NetBSD: Makefile,v 1.1 2002/02/23 19:16:54 thorpej Exp $
|
||||
|
||||
S= ${.CURDIR}/../../../../..
|
||||
|
||||
PLATFORM= IQ80310
|
||||
RELOC= 0x80000
|
||||
MAXIMAGESIZE= 2097152 # 2M
|
||||
LOADADDR= 0xa0200000
|
||||
|
||||
CPPFLAGS+= -DCONSPEED=115200
|
||||
|
||||
LDSCRIPT= ${.CURDIR}/ldscript
|
||||
|
||||
SRCS+= iq80310_cons.c i80312_mem.c
|
||||
|
||||
.include "${S}/arch/evbarm/stand/gzboot/Makefile.gzboot"
|
|
@ -0,0 +1,70 @@
|
|||
OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm",
|
||||
"elf32-littlearm")
|
||||
OUTPUT_ARCH(arm)
|
||||
ENTRY(start)
|
||||
MEMORY
|
||||
{
|
||||
/* We will locate the .text section in flash, and run directly
|
||||
from there. The data and bss sections are small, and we
|
||||
will locate them offset 1MB in SDRAM. */
|
||||
flash : o = 0x80000, l = 6M
|
||||
sdram : o = 0xa0100000, l = 1M /* kernel loads at 0xa0200000 */
|
||||
}
|
||||
SECTIONS
|
||||
{
|
||||
/* Read-only sections, merged into text segment: */
|
||||
.text :
|
||||
{
|
||||
*(.text)
|
||||
*(.text.*)
|
||||
*(.stub)
|
||||
*(.glue_7t) *(.glue_7)
|
||||
*(.rodata) *(.rodata.*)
|
||||
} > flash =0
|
||||
PROVIDE (__etext = .);
|
||||
PROVIDE (_etext = .);
|
||||
PROVIDE (etext = .);
|
||||
.data :
|
||||
AT (ADDR(.text) + SIZEOF(.text))
|
||||
{
|
||||
__data_start = . ;
|
||||
*(.data)
|
||||
*(.data.*)
|
||||
} > sdram
|
||||
.sdata :
|
||||
AT (ADDR(.text) + SIZEOF(.text) + SIZEOF(.data))
|
||||
{
|
||||
*(.sdata)
|
||||
*(.sdata.*)
|
||||
} > sdram
|
||||
_edata = .;
|
||||
PROVIDE (edata = .);
|
||||
__bss_start = .;
|
||||
__bss_start__ = .;
|
||||
.sbss :
|
||||
{
|
||||
PROVIDE (__sbss_start = .);
|
||||
PROVIDE (___sbss_start = .);
|
||||
*(.dynsbss)
|
||||
*(.sbss)
|
||||
*(.sbss.*)
|
||||
*(.scommon)
|
||||
PROVIDE (__sbss_end = .);
|
||||
PROVIDE (___sbss_end = .);
|
||||
} > sdram
|
||||
.bss :
|
||||
{
|
||||
*(.dynbss)
|
||||
*(.bss)
|
||||
*(.bss.*)
|
||||
*(COMMON)
|
||||
/* Align here to ensure that the .bss section occupies space up to
|
||||
_end. Align after .bss to ensure correct alignment even if the
|
||||
.bss section disappears because there are no input sections. */
|
||||
. = ALIGN(32 / 8);
|
||||
} > sdram
|
||||
. = ALIGN(32 / 8);
|
||||
_end = .;
|
||||
_bss_end__ = . ; __bss_end__ = . ; __end__ = . ;
|
||||
PROVIDE (end = .);
|
||||
}
|
Loading…
Reference in New Issue