From a91d5a1a996a251817526de0425da814025130d1 Mon Sep 17 00:00:00 2001 From: thorpej Date: Sat, 23 Feb 2002 19:16:54 +0000 Subject: [PATCH] Example Makefile and linker script for building a run-from-flash gzboot image for the IQ80310 with room for 2M of compressed data. --- .../gzboot/IQ80310_flash_0x80000/Makefile | 16 +++++ .../gzboot/IQ80310_flash_0x80000/ldscript | 70 +++++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 sys/arch/evbarm/stand/gzboot/IQ80310_flash_0x80000/Makefile create mode 100644 sys/arch/evbarm/stand/gzboot/IQ80310_flash_0x80000/ldscript diff --git a/sys/arch/evbarm/stand/gzboot/IQ80310_flash_0x80000/Makefile b/sys/arch/evbarm/stand/gzboot/IQ80310_flash_0x80000/Makefile new file mode 100644 index 000000000000..acc2ff73968e --- /dev/null +++ b/sys/arch/evbarm/stand/gzboot/IQ80310_flash_0x80000/Makefile @@ -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" diff --git a/sys/arch/evbarm/stand/gzboot/IQ80310_flash_0x80000/ldscript b/sys/arch/evbarm/stand/gzboot/IQ80310_flash_0x80000/ldscript new file mode 100644 index 000000000000..1b372fbadad1 --- /dev/null +++ b/sys/arch/evbarm/stand/gzboot/IQ80310_flash_0x80000/ldscript @@ -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 = .); +}