]> git.baikalelectronics.ru Git - kernel.git/commit
objtool, compiler.h: Fix __unreachable section relocation size
authorJosh Poimboeuf <jpoimboe@redhat.com>
Wed, 1 Mar 2017 06:05:04 +0000 (00:05 -0600)
committerIngo Molnar <mingo@kernel.org>
Wed, 1 Mar 2017 13:20:18 +0000 (14:20 +0100)
commitd74769694679e7077d83ca221184d8c5d64ffed1
tree790133e15f28b26db448d1157b4953e881ef2fa0
parentdfcbecdbb4c808b363bac561d5c5c0a21bfbe886
objtool, compiler.h: Fix __unreachable section relocation size

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

  4452eb2a3345 ("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: 4452eb2a3345 ("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>
include/linux/compiler-gcc.h