From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752047AbdCAOa2 (ORCPT ); Wed, 1 Mar 2017 09:30:28 -0500 Received: from terminus.zytor.com ([65.50.211.136]:37650 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751062AbdCAOaZ (ORCPT ); Wed, 1 Mar 2017 09:30:25 -0500 Date: Wed, 1 Mar 2017 04:45:54 -0800 From: tip-bot for Josh Poimboeuf Message-ID: Cc: linux-kernel@vger.kernel.org, tglx@linutronix.de, torvalds@linux-foundation.org, hpa@zytor.com, a.p.zijlstra@chello.nl, jpoimboe@redhat.com, peterz@infradead.org, mingo@kernel.org Reply-To: linux-kernel@vger.kernel.org, tglx@linutronix.de, torvalds@linux-foundation.org, hpa@zytor.com, a.p.zijlstra@chello.nl, peterz@infradead.org, jpoimboe@redhat.com, mingo@kernel.org In-Reply-To: <20170301060504.oltm3iws6fmubnom@treble> References: <20170301060504.oltm3iws6fmubnom@treble> To: linux-tip-commits@vger.kernel.org Subject: [tip:core/urgent] objtool, compiler.h: Fix __unreachable section relocation size Git-Commit-ID: a6ae17f553bf9b4a0c7f8534e5f0f983bc7955c7 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: a6ae17f553bf9b4a0c7f8534e5f0f983bc7955c7 Gitweb: http://git.kernel.org/tip/a6ae17f553bf9b4a0c7f8534e5f0f983bc7955c7 Author: Josh Poimboeuf AuthorDate: Wed, 1 Mar 2017 00:05:04 -0600 Committer: Ingo Molnar CommitDate: Wed, 1 Mar 2017 13:43:05 +0100 objtool, compiler.h: Fix __unreachable section relocation size Linus reported the following commit broke module loading on his laptop: d1091c7fa3d5 ("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 relative kernel addresses. Use relative addresses instead: ".long %c0b - .\t\n" Suggested-by: Linus Torvalds Reported-by: Linus Torvalds Signed-off-by: Josh Poimboeuf Cc: Peter Zijlstra Cc: Peter Zijlstra Cc: Thomas Gleixner Fixes: d1091c7fa3d5 ("objtool: Improve detection of BUG() and other dead ends") Link: http://lkml.kernel.org/r/20170301060504.oltm3iws6fmubnom@treble Signed-off-by: Ingo Molnar --- include/linux/compiler-gcc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index 76e28c2..b6bb901 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h @@ -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__)); \ }) #else