[U-Boot] [PATCH] ARC: Make sure .ivt section is not purged by garbage collector

Alexey Brodkin Alexey.Brodkin at synopsys.com
Tue May 29 19:00:14 UTC 2018


Fixes fac4790491f6 "arc: Eliminate unused code and data with GCC's garbage collector",
see [1].

Since in case of ARCv2 .ivt only contains addrresses of
interrupt/exception handlers linker doesn't understand that this section
actually make a lot of sense and decides to get rid of it if we use
"--gc-sections".

And KEEP does exactly this, see [2].

[1] http://git.denx.de/?p=u-boot.git;a=commit;h=fac4790491f69b29755d92db2cad508849573ff7
[2] https://sourceware.org/binutils/docs/ld/Input-Section-Keep.html#Input-Section-Keep

Signed-off-by: Alexey Brodkin <abrodkin at synopsys.com>
---
 arch/arc/cpu/u-boot.lds | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arc/cpu/u-boot.lds b/arch/arc/cpu/u-boot.lds
index 73c642ed6bd9..d5c88ef9d4d0 100644
--- a/arch/arc/cpu/u-boot.lds
+++ b/arch/arc/cpu/u-boot.lds
@@ -23,7 +23,7 @@ SECTIONS
 	__ivt_start = .;
 	.ivt :
 	{
-		*(.ivt)
+		KEEP(*(.ivt))
 	}
 	__ivt_end = .;
 
-- 
2.17.0



More information about the U-Boot mailing list