From 0907090490b07357902927f089228d63a775cdf0 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Tue, 12 Feb 2019 18:01:11 -0800 Subject: cortex-m: fix vecttable.c when compiling with clang Text section name is adding ",\"a\" @" to the section name. arm-none-eabi-objdump --disassemble-all \ ./build/nocturne_fp/RO/core/cortex-m/vecttable.o Before: Disassembly of section .text.vecttable,"a" @: 00000000 : ... After: Disassembly of section .text.vecttable: 00000000 : ... Comparing the text.vecttable elf section headers for gcc before and after this change, there is no difference to flags: arm-none-eabi-objdump -h \ ./build/nocturne_fp/RO/core/cortex-m/vecttable.o .text.vecttable 00000298 00000000 00000000 00000050 2**2 CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE One difference when compiling with clang is that it sets the DATA attribute in the header, while gcc sets CODE. Since this is an array of addresses, not executable code, I think clang is actually correct: .text.vecttable 00000298 00000000 00000000 00000060 2**2 CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA BRANCH=nocturne,nami BUG=chromium:931797 TEST=make buildall -j Change-Id: I16e57ccd988a8644ed179bed057647c16e96e134 Signed-off-by: Tom Hughes Reviewed-on: https://chromium-review.googlesource.com/1470779 Reviewed-by: Patrick Georgi --- core/cortex-m/vecttable.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'core/cortex-m') diff --git a/core/cortex-m/vecttable.c b/core/cortex-m/vecttable.c index 0f11d03d10..a79b42d16a 100644 --- a/core/cortex-m/vecttable.c +++ b/core/cortex-m/vecttable.c @@ -92,7 +92,11 @@ void svc_helper_handler() */ #define IRQ_UNUSED_OFFSET 8 -#define table(x) func vectors[] __attribute__((section(".text.vecttable,\"a\" @"))) = { x [IRQ_UNUSED_OFFSET] = null }; +#define table(x) \ + const func vectors[] __attribute__((section(".text.vecttable"))) = { \ + x \ + [IRQ_UNUSED_OFFSET] = null \ + }; #define vec(name) name ## _handler, #define irq(num) [num < CONFIG_IRQ_COUNT ? num + IRQ_OFFSET : IRQ_UNUSED_OFFSET] = vec(irq_ ## num) -- cgit v1.2.1