From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA317C282DD for ; Thu, 9 Jan 2020 16:03:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9FD8620721 for ; Thu, 9 Jan 2020 16:03:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="DwCnLZNP" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732858AbgAIQD2 (ORCPT ); Thu, 9 Jan 2020 11:03:28 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:26357 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731296AbgAIQDX (ORCPT ); Thu, 9 Jan 2020 11:03:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578585802; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+U+nGKdjMx0B4G/fm6acyvjMMXdjwiUkB11cChVUwvw=; b=DwCnLZNPUdqRx93VvGsc0D0Hg7SNXi0oOu+yNg6mgkt2NOrdEtJjrwtibqmX40jkDmXksZ m0VdFiQbXRRcNXQxBGtrA6CefZ1F8MTMzwMGg4ITdHw6VlWwXzpx79o/qoG/Os7N3BK0rw 04u/vSBUmaeVCaRd90JoY53A6PCE85k= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-300-VgLJAzLcOvSJ0roM2BW5Kw-1; Thu, 09 Jan 2020 11:03:18 -0500 X-MC-Unique: VgLJAzLcOvSJ0roM2BW5Kw-1 Received: by mail-wm1-f71.google.com with SMTP id p2so1097970wma.3 for ; Thu, 09 Jan 2020 08:03:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+U+nGKdjMx0B4G/fm6acyvjMMXdjwiUkB11cChVUwvw=; b=Lc6MsJE3EVTpxD25hAB1mhaNT6BjwYT9zRudQHx3tXVcS4eo/9Maj8L7T/pnAnBiaz +DZJSPtai+5N2ehtWnmTcYj9UutCwZO7lOEG7eUgUiK3j7By1VtCuAhYcRINlLGJ9Gbo 3e3/5HD5wT5m4AZfKCftYnH5tfjxzn5bKvMzNvbNHzd1mfXHv6kGSmPZaI3NHu8fSzhv 8EQGPYWsLe/UxZLeQ21G1y6UqO/7WmC128/joahahaH1i/3ARGXaPa/zwVUj3ccxeBGG e8lNocdM9CoQpCZta05B7d5bK3ko9+KJQZoURZqiZqBGeEH8047IuQd3EKqNtY7qsP3E 7BOA== X-Gm-Message-State: APjAAAX1Tb3qt8+jruKqTv4h8eHjG3eKlbV0ieLkUhxjWpar7MkRINz4 TinfwnK+uGKwr2r0qv2b55g298bicoXr7xZrlB8Shpc09Sg5L8hlHKsH9RAjUeyxwvL3MO73yu0 NH7aWRrrTdChH99ax8Tnq0vHi X-Received: by 2002:adf:ef0b:: with SMTP id e11mr11689567wro.128.1578585796273; Thu, 09 Jan 2020 08:03:16 -0800 (PST) X-Google-Smtp-Source: APXvYqxcaCDsW9bbAJtdhxvEAdTTp7rkMopW6pzF8N23b9naHbPtWUffbUGHw5DVwkRvjunTIXO26A== X-Received: by 2002:adf:ef0b:: with SMTP id e11mr11689532wro.128.1578585796043; Thu, 09 Jan 2020 08:03:16 -0800 (PST) Received: from redfedo.redhat.com (host81-140-166-164.range81-140.btcentralplus.com. [81.140.166.164]) by smtp.gmail.com with ESMTPSA id z21sm3258969wml.5.2020.01.09.08.03.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jan 2020 08:03:15 -0800 (PST) From: Julien Thierry To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: jpoimboe@redhat.com, peterz@infradead.org, raphael.gault@arm.com, catalin.marinas@arm.com, will@kernel.org, Julien Thierry Subject: [RFC v5 04/57] objtool: check: Ignore empty alternative groups Date: Thu, 9 Jan 2020 16:02:07 +0000 Message-Id: <20200109160300.26150-5-jthierry@redhat.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200109160300.26150-1-jthierry@redhat.com> References: <20200109160300.26150-1-jthierry@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Atlernative section can contain entries for alternatives with no instructions. Objtool will currently crash when handling such an entry. Just skip that entry, but still give a warning to discourage useless entries. Signed-off-by: Julien Thierry --- tools/objtool/check.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 5968e6f08891..27e5380e0e0b 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -866,6 +866,13 @@ static int add_special_section_alts(struct objtool_file *file) } if (special_alt->group) { + if (!special_alt->orig_len) { + WARN("empty alternative entry at %s+0x%lx", + orig_insn->sec->name, + orig_insn->offset); + continue; + } + ret = handle_group_alt(file, special_alt, orig_insn, &new_insn); if (ret) -- 2.21.0 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 872B9C282DD for ; Thu, 9 Jan 2020 16:11:23 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 592CA20661 for ; Thu, 9 Jan 2020 16:11:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="QOvGqpV4"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="CLGPBPtk" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 592CA20661 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=XEqzvQf30r4JARQaXK28iTqGcm4yqGwq3zNfojiER4U=; b=QOvGqpV4ZMBQc8 3tyVeDH2j/65lLu8dd00WVXfMJvFEV9cIwqg4PxNMnQdZZHhDNgI3BISeObbHpSsobAn7eXgg4cOr RNrQyJo5v6BbecqGP/pacLl6LomtcdPrUA0uEEr/0kA3EZBC4fiFLHajnCkARQ2RR/A1DZ3jnKC2F T74hFMe4l4EZIk7LC3i6H3tba0Q9ML69amhm19/7gWoIsf0jttaQ8VxXs50/4RMIWgF6VACHq3cXC nR6VRz/06LFLmU04rsSQx309W98Mqwjctcl57a6zpjpwUQOG0ReBcsgstoqd7AIZEekc0EkWgUa6h X6WBXq3BvHOhHa7mQxtw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ipaP4-0005Pt-U3; Thu, 09 Jan 2020 16:11:22 +0000 Received: from us-smtp-2.mimecast.com ([207.211.31.81] helo=us-smtp-delivery-1.mimecast.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ipaJv-0007dt-2Q for linux-arm-kernel@lists.infradead.org; Thu, 09 Jan 2020 16:06:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578585961; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GmC2xKL3e4Fy+ZDst+0UU0XDQE8Eej6nqhT+4DhHses=; b=CLGPBPtk2J6QSwl9lg+p5d37F0TmcAIHaFVhqGFgRTHR7c8Eo6ZzvyXnwAkO/qn0xn8QYg 0jEtSkvvEm0KcFOPoOY/3MVjY40bOvh4AmPJFAjVt30QWTpq4DLwCZ3yPkTlWjbS/zujjE fTyRJqFvRNolJKdNm5Npyh6ZXJOHd2Q= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-102-if02yHJiP_yebAd8U360Og-1; Thu, 09 Jan 2020 11:03:17 -0500 Received: by mail-wm1-f72.google.com with SMTP id w205so1092799wmb.5 for ; Thu, 09 Jan 2020 08:03:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+U+nGKdjMx0B4G/fm6acyvjMMXdjwiUkB11cChVUwvw=; b=YZdTp+56By7Q4U+zpQrMPNzDvCgrfuMxQQB4Gc2uFrByywV1v7W2+lehj/7p5Uwxcc DWP0KwoX0Q0oeoBeQmjAw8LeiCRNVAP3SNOYJC7515G/Vl2P5cCLBIaJWNyfqx7xlZoJ i9CH6EfQMGbI/Nfb0lyNBEnfl8oKXewfFy5tbUki6QqWOUpBd1ffZhJ3U3J8cdgY+/D+ cZG6Sev0UaBYyrzkmjbidCPH1BQ1U2sKkFC+ZbhcYPGanl8rfqIQ8KD2psyzcGbS3nzN ktJ2zfjHWqNFRIRH4N8IiwWzr6tOze+4eUyibEmloNu0hVAWVF74pRqccDK1h0HHy3wp 4toQ== X-Gm-Message-State: APjAAAVHp1r7lK3kE41qvXJtRCLTH1iF3nXNwLbRJ2fopqSMWiyz/OH4 pEmh9mCuHG3WDbqNvafIhzejs41mjv9+tPf3oBM8zQowRcMQtHAtj1QVGMR46OI7i93D7ipBYqK sBYMPMif1omWflCf1ad6XRbI2nzpKFchodfA= X-Received: by 2002:adf:ef0b:: with SMTP id e11mr11689563wro.128.1578585796272; Thu, 09 Jan 2020 08:03:16 -0800 (PST) X-Google-Smtp-Source: APXvYqxcaCDsW9bbAJtdhxvEAdTTp7rkMopW6pzF8N23b9naHbPtWUffbUGHw5DVwkRvjunTIXO26A== X-Received: by 2002:adf:ef0b:: with SMTP id e11mr11689532wro.128.1578585796043; Thu, 09 Jan 2020 08:03:16 -0800 (PST) Received: from redfedo.redhat.com (host81-140-166-164.range81-140.btcentralplus.com. [81.140.166.164]) by smtp.gmail.com with ESMTPSA id z21sm3258969wml.5.2020.01.09.08.03.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jan 2020 08:03:15 -0800 (PST) From: Julien Thierry To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [RFC v5 04/57] objtool: check: Ignore empty alternative groups Date: Thu, 9 Jan 2020 16:02:07 +0000 Message-Id: <20200109160300.26150-5-jthierry@redhat.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200109160300.26150-1-jthierry@redhat.com> References: <20200109160300.26150-1-jthierry@redhat.com> MIME-Version: 1.0 X-MC-Unique: if02yHJiP_yebAd8U360Og-1 X-Mimecast-Spam-Score: 0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200109_080603_243981_4BA6FF12 X-CRM114-Status: UNSURE ( 9.37 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Julien Thierry , peterz@infradead.org, catalin.marinas@arm.com, raphael.gault@arm.com, jpoimboe@redhat.com, will@kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Atlernative section can contain entries for alternatives with no instructions. Objtool will currently crash when handling such an entry. Just skip that entry, but still give a warning to discourage useless entries. Signed-off-by: Julien Thierry --- tools/objtool/check.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 5968e6f08891..27e5380e0e0b 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -866,6 +866,13 @@ static int add_special_section_alts(struct objtool_file *file) } if (special_alt->group) { + if (!special_alt->orig_len) { + WARN("empty alternative entry at %s+0x%lx", + orig_insn->sec->name, + orig_insn->offset); + continue; + } + ret = handle_group_alt(file, special_alt, orig_insn, &new_insn); if (ret) -- 2.21.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel