From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751143AbdL3VLO (ORCPT ); Sat, 30 Dec 2017 16:11:14 -0500 Received: from terminus.zytor.com ([65.50.211.136]:42961 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751066AbdL3VLM (ORCPT ); Sat, 30 Dec 2017 16:11:12 -0500 Date: Sat, 30 Dec 2017 13:07:40 -0800 From: tip-bot for Simon Ser Message-ID: Cc: torvalds@linux-foundation.org, hpa@zytor.com, peterz@infradead.org, tglx@linutronix.de, contact@emersion.fr, mingo@kernel.org, linux-kernel@vger.kernel.org, jpoimboe@redhat.com Reply-To: peterz@infradead.org, tglx@linutronix.de, torvalds@linux-foundation.org, hpa@zytor.com, linux-kernel@vger.kernel.org, jpoimboe@redhat.com, contact@emersion.fr, mingo@kernel.org In-Reply-To: References: To: linux-tip-commits@vger.kernel.org Subject: [tip:core/urgent] objtool: Fix seg fault with clang-compiled objects Git-Commit-ID: ce90aaf5cde4ce057b297bb6c955caf16ef00ee6 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: ce90aaf5cde4ce057b297bb6c955caf16ef00ee6 Gitweb: https://git.kernel.org/tip/ce90aaf5cde4ce057b297bb6c955caf16ef00ee6 Author: Simon Ser AuthorDate: Sat, 30 Dec 2017 14:43:32 -0600 Committer: Ingo Molnar CommitDate: Sat, 30 Dec 2017 22:04:17 +0100 objtool: Fix seg fault with clang-compiled objects Fix a seg fault which happens when an input file provided to 'objtool orc generate' doesn't have a '.shstrtab' section (for instance, object files produced by clang don't have this section). Signed-off-by: Simon Ser Signed-off-by: Josh Poimboeuf Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/c0f2231683e9bed40fac1f13ce2c33b8389854bc.1514666459.git.jpoimboe@redhat.com Signed-off-by: Ingo Molnar --- tools/objtool/orc_gen.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/objtool/orc_gen.c b/tools/objtool/orc_gen.c index e5ca314..e61fe70 100644 --- a/tools/objtool/orc_gen.c +++ b/tools/objtool/orc_gen.c @@ -165,6 +165,8 @@ int create_orc_sections(struct objtool_file *file) /* create .orc_unwind_ip and .rela.orc_unwind_ip sections */ sec = elf_create_section(file->elf, ".orc_unwind_ip", sizeof(int), idx); + if (!sec) + return -1; ip_relasec = elf_create_rela_section(file->elf, sec); if (!ip_relasec)