diff options
author | Tom Hughes <tomhughes@chromium.org> | 2019-02-12 18:01:11 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-03-08 21:20:51 -0800 |
commit | 0907090490b07357902927f089228d63a775cdf0 (patch) | |
tree | b50c72c62b6ace48bdfb2af4e1e9fefe74a2b11c | |
parent | c67a566dbcca552b3d7cea57832685c2a83033d6 (diff) | |
download | chrome-ec-0907090490b07357902927f089228d63a775cdf0.tar.gz |
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 <vectors>:
...
After:
Disassembly of section .text.vecttable:
00000000 <vectors>:
...
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 <tomhughes@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1470779
Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
-rw-r--r-- | core/cortex-m/vecttable.c | 6 |
1 files changed, 5 insertions, 1 deletions
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) |