aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/cpu/u-boot-spl.lds
AgeCommit message (Collapse)AuthorFilesLines
2024-06-07arm: move _end to linker symbolsIlias Apalodimas1-5/+1
commit 6e2228fb052b ("Merge patch series "Clean up arm linker scripts") was cleaning up linker scripts for armv7 and v8 but was leaving _end and __secure_stack_start/end. commit d0b5d9da5de2 ("arm: make _end compiler-generated") was moving _end to be compiler generated. _end is defined as c variable in its own section to force the compiler emit relative a reference. However, defining those in the linker script will do the same thing since [0]. So let's remove the special sections from the linker scripts, the variable definitions from sections.c and define them as a symbols. It's worth noting that _image_binary_end symbol is now redundant and can be removed in the future. - SPL The .end section has been removed from the new binary [ 5] .end PROGBITS 00000000fffdf488 000000000002f488 0 0000000000000000 0000000000000000 0 1 [0000000000000003]: WRITE, ALLOC $~ bloat-o-meter kria_old/spl/u-boot-spl krina_new/spl/u-boot-spl add/remove: 0/0 grow/shrink: 0/0 up/down: 0/0 (0) Function old new delta Total: Before=115980, After=115980, chg +0.00% $~ readelf -sW kria_old/u-boot kria_new/u-boot | grep -w _end 12047: 000000000813a0f0 0 OBJECT GLOBAL DEFAULT 11 _end 12047: 000000000813a118 0 NOTYPE GLOBAL DEFAULT 11 _end $~ readelf -sW kria_old/spl/u-boot-spl kria_new/spl/u-boot-spl | grep -w _end 1605: 00000000fffdf488 0 OBJECT GLOBAL DEFAULT 5 _end 1603: 00000000fffdf498 0 NOTYPE GLOBAL DEFAULT 4 _end $~ readelf -sW old/u-boot new/u-boot | grep -w _end 8847: 0000000000103710 0 OBJECT GLOBAL DEFAULT 11 _end 8847: 0000000000103738 0 NOTYPE GLOBAL DEFAULT 11 _end $~ readelf -sW old_v7/u-boot new_v7/u-boot | grep -w _end 10638: 000da824 0 OBJECT GLOBAL DEFAULT 10 _end 10637: 000da84c 0 NOTYPE GLOBAL DEFAULT 10 _end - For both QEMU instances $~ bloat-o-meter old/u-boot new/u-boot add/remove: 0/0 grow/shrink: 1/0 up/down: 20/0 (20) Function old new delta version_string 50 70 +20 Total: Before=656915, After=656935, chg +0.00% [0] binutils commit 6b3b0ab89663 ("Make linker assigned symbol dynamic only for shared object") Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-03-29arm: move image_copy_start/end to linker symbolsIlias Apalodimas1-1/+1
image_copy_start/end are defined as c variables in order to force the compiler emit relative references. However, defining those within a section definition will do the same thing since [0]. So let's remove the special sections from the linker scripts, the variable definitions from sections.c and define them as a symbols within a section. [0] binutils commit 6b3b0ab89663 ("Make linker assigned symbol dynamic only for shared object") Suggested-by: Sam Edwards <CFSworks@gmail.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Tested-by: Sam Edwards <CFSworks@gmail.com> # Binary output identical Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2022-06-23linker_lists: Rename sections to remove . prefixAndrew Scull1-2/+2
Rename the sections used to implement linker lists so they begin with '__u_boot_list' rather than '.u_boot_list'. The double underscore at the start is still distinct from the single underscore used by the symbol names. Having a '.' in the section names conflicts with clang's ASAN instrumentation which tries to add redzones between the linker list elements, causing expected accesses to fail. However, clang doesn't try to add redzones to user sections, which are names with all alphanumeric and underscore characters. Signed-off-by: Andrew Scull <ascull@google.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2019-05-05spl: fix linker size check off-by-one errorsSimon Goldschmidt1-3/+3
This fixes SPL linker script size checks for 3 lds files where the size checks were implemented as "x < YYY_MAX_SIZE". Fix the size checks to be "x <= YYY_MAX_SIZE" instead. Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
2019-01-26linker: Modify linker scripts to be more genericTom Rini1-2/+2
Make use of "IMAGE_MAX_SIZE" and "IMAGE_TEXT_BASE" rather than CONFIG_SPL_MAX_SIZE and CONFIG_SPL_TEXT_BASE. This lets us re-use the same script for both SPL and TPL. Add logic to scripts/Makefile.spl to pass in the right value when preprocessing the script. Cc: Stefano Babic <sbabic@denx.de> Cc: Fabio Estevam <fabio.estevam@nxp.com> Cc: Jagan Teki <jagan@openedev.com> Cc: Maxime Ripard <maxime.ripard@bootlin.com> Cc: Andreas Bießmann <andreas@biessmann.org> Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Cc: Michal Simek <monstr@monstr.eu> Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Cc: York Sun <york.sun@nxp.com> Cc: Bin Meng <bmeng.cn@gmail.com> Cc: Heiko Schocher <hs@denx.de> Cc: Adam Ford <aford173@gmail.com> Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Tested-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Tested-by: Adam Ford <aford173@gmail.com> #da850evm & omap3_logic_somlv Reviewed-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
2018-05-07SPDX: Convert all of our single license tags to Linux Kernel styleTom Rini1-2/+1
When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: Tom Rini <trini@konsulko.com>
2018-04-27ARM: spl: include arm/thumb glue sectionsMans Rullgard1-0/+1
When building in Thumb mode, the linker might generate mode switching stubs in .glue sections. Include these in the final link. Signed-off-by: Mans Rullgard <mans@mansr.com>
2017-12-12binman: arm: Include the binman symbol tableSimon Glass1-0/+7
This area of the image contains symbols whose values are filled in by binman. If this feature is not used, the table is empty. Add this to the ARM SPL link script. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-03-16spl: arm: Make sure to include all of the u_boot_list entriesTom Rini1-8/+1
Starting with 96e5b03 we use a linker list for partition table information. However since we use this in SPL we need to make sure that the SPL linker scripts include these as well. While doing this, it's best to simply include all linker lists to future proof ourselves. Cc: Andreas Bießmann <andreas.devel@googlemail.com> Acked-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reported-by: Nishanth Menon <nm@ti.com> Tested-by: Nishanth Menon <nm@ti.com> Signed-off-by: Tom Rini <trini@konsulko.com>
2015-07-21dm: arm: Put driver model I2C drivers before legacy onesSimon Glass1-5/+5
Driver-model I2C drivers can be picked up by the linker script rule for legacy drivers. Change the order to avoid this. We could make the legacy code depend on !CONFIG_DM_I2C but that is not necessary and it is good to keep conditions to a minimum. Signed-off-by: Simon Glass <sjg@chromium.org>
2015-07-21dm: Reduce SPL device tree sizeSimon Glass1-1/+1
The SPL device tree size must be minimised to save memory. Only include properties that are needed by SPL - this is determined by the presence of the "u-boot,dm-pre-reloc" property. Also remove a predefined list of unused properties from the nodes that remain. Signed-off-by: Simon Glass <sjg@chromium.org>
2014-12-11arm: spl: Add I2C linker list in generic .ldsAlison Wang1-0/+3
On LS1, DDR is initialized by reading SPD through I2C interface in SPL code. For I2C, ll_entry_count() is called, and it returns the number of elements of a linker-generated array placed into subsection of .u_boot_list section specified by _list argument. So add I2C linker list in the generic .lds to fix the issue about using I2C in SPL. Signed-off-by: Alison Wang <alison.wang@freescale.com> Reviewed-by: York Sun <yorksun@freescale.com>
2014-11-21dm: arm: spl: Make driver model linker lists availableSimon Glass1-0/+7
The linker lists feature is useful in SPL as it holds the driver model platform data. So don't throw away the lists. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@ti.com>
2014-05-15arm: move exception handling out of start.S filesAlbert ARIBAUD1-0/+1
Exception handling is basically identical for all ARM targets. Factorize it out of the various start.S files and into a single vectors.S file, and adjust linker scripts accordingly. Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
2014-02-26arm: make _end compiler-generatedAlbert ARIBAUD1-2/+7
This prevents references to _end from generating absolute relocation records. This change is binary invariant for ARM targets. Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
2013-12-07arm: keep all sections in ELF fileAlbert ARIBAUD1-6/+9
Current LDS files /DISCARD/ a lot of sections when linking ELF files, causing diagnostic tools such as readelf or objdump to produce partial output. Keep all section at link stage, filter only at objcopy time so that .bin remains minimal. Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net> Reviewed-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
2013-07-24Add GPL-2.0+ SPDX-License-Identifier to source filesWolfgang Denk1-17/+1
Signed-off-by: Wolfgang Denk <wd@denx.de> [trini: Fixup common/cmd_io.c] Signed-off-by: Tom Rini <trini@ti.com>
2013-06-21remove all references to .dynsymAlbert ARIBAUD1-5/+1
Discard all .dynsym sections from linker scripts Remove all __dynsym_start definitions from linker scripts Remove all __dynsym_start references from the codebase Note: this touches include/asm-generic/sections.h, which is not ARM-specific, but actual uses of __dynsym_start are only in ARM, so this patch can safely go through the ARM repository. Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net> Tested-by: Lubomir Popov <lpopov@mm-sol.com> Tested-by: Jeroen Hofstee <jeroen@myspectrum.nl> Reviewed-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
2013-04-14ARM: fix CONFIG_SPL_MAX_SIZE semanticsAlbert ARIBAUD1-11/+13
Remove SPL-related ASSERT() in arch/arm/cpu/u-boot.lds as this file is never used for SPL builds. Rewrite the ASSERT() in arch/arm/cpu/u-boot-spl.lds to separately test image (text,data,rodata...) size, BSS size, and full footprint each against its own max, and make Tegra boards check full footprint. Also, output section mmutable is not used in SPL builds. Remove it. Finally, update README regarding the (now homogeneous) semantics of CONFIG_SPL_[BSS_]MAX_SIZE and add the new CONFIG_SPL_MAX_FOOTPRINT macro. Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net> Reported-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
2013-03-18Merge branch 'master' of git://git.denx.de/u-boot-armTom Rini1-0/+93
Albert's rework of the linker scripts conflicted with Simon's making everyone use __bss_end. We also had a minor conflict over README.scrapyard being added to in mainline and enhanced in u-boot-arm/master with proper formatting. Conflicts: arch/arm/cpu/ixp/u-boot.lds arch/arm/cpu/u-boot.lds arch/arm/lib/Makefile board/actux1/u-boot.lds board/actux2/u-boot.lds board/actux3/u-boot.lds board/dvlhost/u-boot.lds board/freescale/mx31ads/u-boot.lds doc/README.scrapyard include/configs/tegra-common.h Build tested for all of ARM and run-time tested on am335x_evm. Signed-off-by: Tom Rini <trini@ti.com>
2013-03-12Remove linker lists (LGAs) from SPL linker scriptsAlbert ARIBAUD1-0/+93
Many SPL linker scripts needlessly include linker lists (aka LGAs). Remove them whenever possible; keep it only in the seven am335x_evm variants (am335x_evm, am335x_evm_uart[1-5], am335x_evm_spiboot), where there is actual content in output section .u_boot_list. This commit keeps all u-boot.bin and u-boot-spl.bin in ARM targets byte-identical. Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>