9
0
Fork 0
barebox/arch/arm/lib/barebox.lds.S

122 lines
2.3 KiB
ArmAsm
Raw Normal View History

2007-10-17 16:23:34 +00:00
/*
* (C) Copyright 2000-2004
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
*
* 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.
*
*
*/
#include <asm-generic/barebox.lds.h>
2007-10-17 16:23:34 +00:00
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(start)
2007-10-17 16:23:34 +00:00
SECTIONS
{
#ifdef CONFIG_RELOCATABLE
. = 0x0;
#else
2007-10-17 16:23:34 +00:00
. = TEXT_BASE;
#endif
2007-10-17 16:23:34 +00:00
#ifndef CONFIG_PBL_IMAGE
PRE_IMAGE
#endif
2007-10-17 16:23:34 +00:00
. = ALIGN(4);
.text :
{
_stext = .;
_text = .;
*(.text_entry*)
__bare_init_start = .;
*(.text_bare_init*)
__bare_init_end = .;
__exceptions_start = .;
KEEP(*(.text_exceptions*))
__exceptions_stop = .;
*(.text*)
2007-10-17 16:23:34 +00:00
}
BAREBOX_BARE_INIT_SIZE
2007-10-17 16:23:34 +00:00
. = ALIGN(4);
.rodata : { *(.rodata*) }
2007-10-17 16:23:34 +00:00
#ifdef CONFIG_ARM_UNWIND
/*
* Stack unwinding tables
*/
. = ALIGN(8);
.ARM.unwind_idx : {
__start_unwind_idx = .;
*(.ARM.exidx*)
__stop_unwind_idx = .;
}
.ARM.unwind_tab : {
__start_unwind_tab = .;
*(.ARM.extab*)
__stop_unwind_tab = .;
}
#endif
2007-10-17 16:23:34 +00:00
_etext = .; /* End of text and rodata section */
_sdata = .;
2007-10-17 16:23:34 +00:00
. = ALIGN(4);
.data : { *(.data*) }
2007-10-17 16:23:34 +00:00
Add support for metadata in barebox images It's often useful to get some information about a barebox image before starting or flashing it. This patch introduces barebox Image MetaData (IMD). When enabled a barebox image will contain a list of tags containing the desired information. We have tags for: - the barebox release (2014.07.0-00160-g035de50-dirty) - the build timestamp (#741 Mon Jul 28 15:08:54 CEST 2014) - the board model the image is intended for - the device tree toplevel compatible property Also there is an additional generic key-value store which stores parameters for which no dedicated tag exists. In this patch it is used for the memory size an image supports. Since there is no fixed offset in a barebox image which can be used for storing the information, the metadata is stored somewhere in the image and found by iterating over the image. This works for most image types, but obviously not for SoC images which are encoded or encrypted in some way. There is a 'imd' tool compiled from the same sources for barebox, for the compile host and for the target, so the metadata information is available whereever needed. For device tree boards the model and of_compatible tags are automatically generated. Example output of the imd tool for a Phytec phyFLEX image: build: #889 Wed Jul 30 16:08:54 CEST 2014 release: 2014.07.0-00167-g6b2070d-dirty parameter: memsize=1024 of_compatible: phytec,imx6x-pbab01 phytec,imx6dl-pfla02 fsl,imx6dl model: Phytec phyFLEX-i.MX6 Duallite Carrier-Board Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-28 05:22:40 +00:00
.barebox_imd : { BAREBOX_IMD }
2007-10-17 16:23:34 +00:00
. = .;
__barebox_cmd_start = .;
.barebox_cmd : { BAREBOX_CMDS }
__barebox_cmd_end = .;
2007-10-17 16:23:34 +00:00
__barebox_magicvar_start = .;
.barebox_magicvar : { BAREBOX_MAGICVARS }
__barebox_magicvar_end = .;
__barebox_initcalls_start = .;
.barebox_initcalls : { INITCALLS }
__barebox_initcalls_end = .;
2007-10-17 16:23:34 +00:00
__usymtab_start = .;
__usymtab : { BAREBOX_SYMS }
2007-10-17 16:23:34 +00:00
__usymtab_end = .;
.oftables : { BAREBOX_CLK_TABLE() }
.dtb : { BAREBOX_DTB() }
.rel.dyn : {
__rel_dyn_start = .;
*(.rel*)
__rel_dyn_end = .;
}
.dynsym : {
__dynsym_start = .;
*(.dynsym)
__dynsym_end = .;
}
_edata = .;
2007-10-17 16:23:34 +00:00
. = ALIGN(4);
__bss_start = .;
.bss : { *(.bss*) }
__bss_stop = .;
2007-10-17 16:23:34 +00:00
_end = .;
_barebox_image_size = __bss_start - TEXT_BASE;
2007-10-17 16:23:34 +00:00
}