]> git.baikalelectronics.ru Git - kernel.git/commit
objtool: Fix seg fault with gold linker
authorJosh Poimboeuf <jpoimboe@redhat.com>
Mon, 15 Jan 2018 14:17:07 +0000 (08:17 -0600)
committerIngo Molnar <mingo@kernel.org>
Tue, 16 Jan 2018 00:27:27 +0000 (01:27 +0100)
commit4c0ddb9e8184c86a3d2276e8276d7f6cb4a6dec2
tree1433f20a6e48c4e1d83c0445fbd23c726b33098a
parentcd9dfd02c2008a9ef3ba2ecec5efe39b5c9f5170
objtool: Fix seg fault with gold linker

Objtool segfaults when the gold linker is used with
CONFIG_MODVERSIONS=y and CONFIG_UNWINDER_ORC=y.

With CONFIG_MODVERSIONS=y, the .o file gets passed to the linker before
being passed to objtool.  The gold linker seems to strip unused ELF
symbols by default, which confuses objtool and causes the seg fault when
it's trying to generate ORC metadata.

Objtool should really be running immediately after GCC anyway, without a
linker call in between.  Change the makefile ordering so that objtool is
called before the linker.

Reported-and-tested-by: Markus <M4rkusXXL@web.de>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Fixes: 1e065c946d58 ("x86/unwind: Add the ORC unwinder")
Link: http://lkml.kernel.org/r/355f04da33581f4a3bf82e5b512973624a1e23a2.1516025651.git.jpoimboe@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
scripts/Makefile.build