Skip to content

Commit 55149d0

Browse files
jpoimboeIngo Molnar
authored andcommitted
objtool, compiler.h: Fix __unreachable section relocation size
Linus reported the following commit broke module loading on his laptop: d1091c7 ("objtool: Improve detection of BUG() and other dead ends") It showed errors like the following: module: overflow in relocation type 10 val ffffffffc02afc81 module: 'nvme' likely not compiled with -mcmodel=kernel The problem is that the __unreachable section addresses are stored using the '.long' asm directive, which isn't big enough for .text section kernel addresses. Use relative addresses instead: ".long %c0b - .\t\n" Suggested-by: Linus Torvalds <torvalds@linux-foundation.org> Reported-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Fixes: d1091c7 ("objtool: Improve detection of BUG() and other dead ends") Link: http://lkml.kernel.org/r/20170301060504.oltm3iws6fmubnom@treble Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent 2d6be4a commit 55149d0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/linux/compiler-gcc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@
201201
#define annotate_unreachable() ({ \
202202
asm("%c0:\t\n" \
203203
".pushsection __unreachable, \"a\"\t\n" \
204-
".long %c0b\t\n" \
204+
".long %c0b - .\t\n" \
205205
".popsection\t\n" : : "i" (__LINE__)); \
206206
})
207207
#else

0 commit comments

Comments
 (0)