Commit 55149d06 authored by Josh Poimboeuf's avatar Josh Poimboeuf Committed by Ingo Molnar

objtool, compiler.h: Fix __unreachable section relocation size

Linus reported the following commit broke module loading on his laptop:

  d1091c7f ("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: default avatarLinus Torvalds <>
Reported-by: default avatarLinus Torvalds <>
Signed-off-by: default avatarJosh Poimboeuf <>
Cc: Peter Zijlstra <>
Cc: Peter Zijlstra <>
Cc: Thomas Gleixner <>
Fixes: d1091c7f ("objtool: Improve detection of BUG() and other dead ends")
Link: default avatarIngo Molnar <>
parent 2d6be4ab
......@@ -201,7 +201,7 @@
#define annotate_unreachable() ({ \
asm("%c0:\t\n" \
".pushsection __unreachable, \"a\"\t\n" \
".long %c0b\t\n" \
".long %c0b - .\t\n" \
".popsection\t\n" : : "i" (__LINE__)); \
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment