Skip to content

Commit e2ef115

Browse files
author
Peter Zijlstra
committed
objtool: Fix STACK_FRAME_NON_STANDARD reloc type
STACK_FRAME_NON_STANDARD results in inconsistent relocation types depending on .c or .S usage: Relocation section '.rela.discard.func_stack_frame_non_standard' at offset 0x3c01090 contains 5 entries: Offset Info Type Symbol's Value Symbol's Name + Addend 0000000000000000 00020c2200000002 R_X86_64_PC32 0000000000047b40 do_suspend_lowlevel + 0 0000000000000008 0002461e00000001 R_X86_64_64 00000000000480a0 machine_real_restart + 0 0000000000000010 0000001400000001 R_X86_64_64 0000000000000000 .rodata + b3d4 0000000000000018 0002444600000002 R_X86_64_PC32 00000000000678a0 __efi64_thunk + 0 0000000000000020 0002659d00000001 R_X86_64_64 0000000000113160 __crash_kexec + 0 Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 3ff5f78 commit e2ef115

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

include/linux/objtool.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ struct unwind_hint {
4040

4141
#ifdef CONFIG_STACK_VALIDATION
4242

43+
#include <asm/asm.h>
44+
4345
#ifndef __ASSEMBLY__
4446

4547
#define UNWIND_HINT(sp_reg, sp_offset, type, end) \
@@ -137,7 +139,7 @@ struct unwind_hint {
137139

138140
.macro STACK_FRAME_NON_STANDARD func:req
139141
.pushsection .discard.func_stack_frame_non_standard, "aw"
140-
.long \func - .
142+
_ASM_PTR \func
141143
.popsection
142144
.endm
143145

tools/include/linux/objtool.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ struct unwind_hint {
4040

4141
#ifdef CONFIG_STACK_VALIDATION
4242

43+
#include <asm/asm.h>
44+
4345
#ifndef __ASSEMBLY__
4446

4547
#define UNWIND_HINT(sp_reg, sp_offset, type, end) \
@@ -137,7 +139,7 @@ struct unwind_hint {
137139

138140
.macro STACK_FRAME_NON_STANDARD func:req
139141
.pushsection .discard.func_stack_frame_non_standard, "aw"
140-
.long \func - .
142+
_ASM_PTR \func
141143
.popsection
142144
.endm
143145

0 commit comments

Comments
 (0)