[PATCH 05/11] ARM: BUG: Move __bug_table creation to __BUG_ENTRY_GENERIC() macro
Sebastian Andrzej Siewior
sebastian at breakpoint.cc
Fri Oct 9 15:21:12 PDT 2026
Move the creation of the __bug_table section into a custom macro
__BUG_ENTRY_GENERIC() and make it depend on CONFIG_GENERIC_BUG.
This is preparatory work to make the creation of BUG-opcode and the
additional tables depend on CONFIG_GENERIC_BUG instead
CONFIG_DEBUG_BUGVERBOSE.
Signed-off-by: Sebastian Andrzej Siewior <sebastian at breakpoint.cc>
---
arch/arm/include/asm/bug.h | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/arch/arm/include/asm/bug.h b/arch/arm/include/asm/bug.h
index 18dc13a0509f6..172e6a84541cb 100644
--- a/arch/arm/include/asm/bug.h
+++ b/arch/arm/include/asm/bug.h
@@ -35,9 +35,8 @@
.word 2b; \
.hword __line; \
-#define __BUG__LINE(__file, __line, __value) \
- 1: ; \
- BUG_ENCODING(); \
+#ifdef CONFIG_GENERIC_BUG
+#define __BUG_ENTRY_GENERIC(__file, __line, __value) \
.pushsection __bug_table,"aw"; \
.align 2; \
.word 1b; \
@@ -45,6 +44,15 @@
.hword 0; \
.popsection;
+#else
+#define __BUG_ENTRY_GENERIC(__file, __line, __value)
+#endif
+
+#define __BUG__LINE(__file, __line, __value) \
+ 1: ; \
+ BUG_ENCODING(); \
+ __BUG_ENTRY_GENERIC(__file, __line, __value);
+
/*
* The extra indirection is to ensure that the __FILE__ string comes through
* OK. Many version of gcc do not support the asm %c parameter which would be
--
2.55.0
More information about the linux-arm-kernel
mailing list