]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ARM: 9444/1: add KEEP() keyword to ARM_VECTORS
authorChristian Eggers <ceggers@arri.de>
Thu, 20 Mar 2025 21:33:51 +0000 (22:33 +0100)
committerRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Wed, 26 Mar 2025 13:31:48 +0000 (13:31 +0000)
Without this, the vectors are removed if LD_DEAD_CODE_DATA_ELIMINATION
is enabled.  At startup, the CPU (silently) hangs in the undefined
instruction exception as soon as the first timer interrupt arrives.

On my setup, the system also boots fine without the 2nd and 3rd KEEP()
statements, so I cannot tell whether these are actually required.

[nathan: Use OVERLAY_KEEP() to avoid breaking old ld.lld versions]

Cc: stable@vger.kernel.org
Fixes: ed0f94102251 ("ARM: 9404/1: arm32: enable HAVE_LD_DEAD_CODE_DATA_ELIMINATION")
Signed-off-by: Christian Eggers <ceggers@arri.de>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
arch/arm/include/asm/vmlinux.lds.h

index a54db342653ab0fcaa3a42ae4f7d4e8587e4c8ff..0341973e30e1c4f9e97e7d0cd98f24bb22fd2058 100644 (file)
        __vectors_lma = .;                                              \
        OVERLAY 0xffff0000 : NOCROSSREFS AT(__vectors_lma) {            \
                .vectors {                                              \
-                       *(.vectors)                                     \
+                       OVERLAY_KEEP(*(.vectors))                       \
                }                                                       \
                .vectors.bhb.loop8 {                                    \
-                       *(.vectors.bhb.loop8)                           \
+                       OVERLAY_KEEP(*(.vectors.bhb.loop8))             \
                }                                                       \
                .vectors.bhb.bpiall {                                   \
-                       *(.vectors.bhb.bpiall)                          \
+                       OVERLAY_KEEP(*(.vectors.bhb.bpiall))            \
                }                                                       \
        }                                                               \
        ARM_LMA(__vectors, .vectors);                                   \