Skip to contentSkip to conversation

ARM: fix link warning with XIP + frame-pointer

PATCH In review Arnd Bergmann 3 participants 3 messages Jan 12, 2021 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: fix link warning with XIP + frame-pointer

From: Arnd Bergmann <[email protected]>

When frame pointers are used instead of the ARM unwinder, and the kernel is built using clang with an external assembler and CONFIG_XIP_KERNEL, every file produces two warnings like:

arm-linux-gnueabi-ld: warning: orphan section .ARM.extab' from net/mac802154/util.o' being placed in section `.ARM.extab'
arm-linux-gnueabi-ld: warning: orphan section .ARM.exidx' from net/mac802154/util.o' being placed in section `.ARM.exidx'

The same fix was already merged for the normal (non-XIP) linker script, with a longer description.

Fixes c39866f268f8 ("arm/build: Always handle .ARM.exidx and .ARM.extab sections")
---
 arch/arm/kernel/vmlinux-xip.lds.S | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/kernel/vmlinux-xip.lds.S +4 -0
index 4d0b0cd9222e..ddb70c65d525 100644
@@ -43,6 +43,10 @@ SECTIONS
 		ARM_DISCARD
 		*(.alt.smp.init)
 		*(.pv_table)
+#ifndef CONFIG_ARM_UNWIND
+		*(.ARM.exidx) *(.ARM.exidx.*)
+		*(.ARM.extab) *(.ARM.extab.*)
+#endif
 	}
 
 	. = XIP_VIRT_ADDR(CONFIG_XIP_PHYS_ADDR);
Signature · 1 line
2.29.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

When frame pointers are used instead of the ARM unwinder, and the kernel is built using clang with an external assembler and CONFIG_XIP_KERNEL, every file produces two warnings like:

Quoted 8 lines

arm-linux-gnueabi-ld: warning: orphan section .ARM.extab' from net/mac802154/util.o' being placed in section `.ARM.extab'
arm-linux-gnueabi-ld: warning: orphan section .ARM.exidx' from net/mac802154/util.o' being placed in section `.ARM.exidx'

The same fix was already merged for the normal (non-XIP) linker script, with a longer description.

Fixes c39866f268f8 ("arm/build: Always handle .ARM.exidx and .ARM.extab sections")
Quoted 22 lines
---
 arch/arm/kernel/vmlinux-xip.lds.S | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/kernel/vmlinux-xip.lds.S +4 -0
index 4d0b0cd9222e..ddb70c65d525 100644
@@ -43,6 +43,10 @@ SECTIONS
 		ARM_DISCARD
 		*(.alt.smp.init)
 		*(.pv_table)
+#ifndef CONFIG_ARM_UNWIND
+		*(.ARM.exidx) *(.ARM.exidx.*)
+		*(.ARM.extab) *(.ARM.extab.*)
+#endif
 	}
 
 	. = XIP_VIRT_ADDR(CONFIG_XIP_PHYS_ADDR);
Signature · 1 line
2.29.2
Reviewed-by on v1 1/1
#2 lore raw
In reply to Arnd Bergmann
Quoted 7 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

When frame pointers are used instead of the ARM unwinder, and the kernel is built using clang with an external assembler and CONFIG_XIP_KERNEL, every file produces two warnings like:

Quoted 8 lines

arm-linux-gnueabi-ld: warning: orphan section .ARM.extab' from net/mac802154/util.o' being placed in section `.ARM.extab'
arm-linux-gnueabi-ld: warning: orphan section .ARM.exidx' from net/mac802154/util.o' being placed in section `.ARM.exidx'

The same fix was already merged for the normal (non-XIP) linker script, with a longer description.

Fixes c39866f268f8 ("arm/build: Always handle .ARM.exidx and .ARM.extab sections")
Signature · 6 lines
Kees Cook

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel