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)
commit2a0098d70640dda192a79966c14d449e7a34d675
tree1433f20a6e48c4e1d83c0445fbd23c726b33098a
parent28d437d550e1e39f805d99f9f8ac399c778827b7
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: ee9f8fce9964 ("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