From 10f2bdfc5709bb8780ba41224d4c867eec26c431 Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Thu, 14 Feb 2019 23:48:18 -0600 Subject: [PATCH] linker: riscv32: Fix .riscv.attributes orphan sections warning Add similar fix to riscv32 linker scripts that we have on ARM for .riscv.attributes section. Signed-off-by: Kumar Gala --- include/arch/riscv32/common/linker.ld | 6 ++++++ soc/riscv32/openisa_rv32m1/linker.ld | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/include/arch/riscv32/common/linker.ld b/include/arch/riscv32/common/linker.ld index 1d37d22bf4f..78af25067b8 100644 --- a/include/arch/riscv32/common/linker.ld +++ b/include/arch/riscv32/common/linker.ld @@ -191,4 +191,10 @@ SECTIONS #include + SECTION_PROLOGUE(.riscv.attributes, 0,) + { + KEEP(*(.riscv.attributes)) + KEEP(*(.gnu.attributes)) + } + } diff --git a/soc/riscv32/openisa_rv32m1/linker.ld b/soc/riscv32/openisa_rv32m1/linker.ld index 845709d35fa..7a598de030c 100644 --- a/soc/riscv32/openisa_rv32m1/linker.ld +++ b/soc/riscv32/openisa_rv32m1/linker.ld @@ -191,6 +191,11 @@ SECTIONS #include + SECTION_PROLOGUE(.riscv.attributes, 0,) + { + KEEP(*(.riscv.attributes)) + KEEP(*(.gnu.attributes)) + } /* * Pulpino toolchains emit these sections; we don't care about them, * but need to avoid build system warnings about orphaned sections.