From 4a8ced590b724ef2d3d1a9d58df2b0d795391027 Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Thu, 22 Nov 2018 12:35:17 +0100 Subject: [PATCH] tools/gen-device-svd: generate .s files compatible with lld The llvm linker expects some flags to line up in input sections mapped to a particular output section, which the GNU linker ignored. Make sure this flag is set in the input section, see: https://svnweb.freebsd.org/base/stable/11/sys/arm/arm/locore-v4.S?r1=321049&r2=321048&pathrev=321049 --- tools/gen-device-svd.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/gen-device-svd.py b/tools/gen-device-svd.py index 0fd1ecf4..f823d340 100755 --- a/tools/gen-device-svd.py +++ b/tools/gen-device-svd.py @@ -385,7 +385,10 @@ Default_Handler: .set \\handler, Default_Handler .endm -.section .isr_vector +// Must set the "a" flag on the section: +// https://svnweb.freebsd.org/base/stable/11/sys/arm/arm/locore-v4.S?r1=321049&r2=321048&pathrev=321049 +// https://sourceware.org/binutils/docs/as/Section.html#ELF-Version +.section .isr_vector, "a", %progbits .global __isr_vector // Interrupt vector as defined by Cortex-M, starting with the stack top. // On reset, SP is initialized with *0x0 and PC is loaded with *0x4, loading