Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2594603ybb; Fri, 27 Mar 2020 08:30:39 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvjHfQff918SspWpdJwobhdilVqXMohXZNwgh+qXirZzN7hlgMGbWm/MaoNsOWoGsjYseXe X-Received: by 2002:aca:534d:: with SMTP id h74mr4138146oib.173.1585323038835; Fri, 27 Mar 2020 08:30:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585323038; cv=none; d=google.com; s=arc-20160816; b=VBpN90KyqYm8heBMQY7V9c6idB2lstXGHnLzOHaY8x4KNy0uKKyprJ5pbXUiRmYmbv T14ndbUWiYBxNqumozkIACqk7oImTd4OoiUZfVrBZrD6lNk7jINGW9dPSWIj76kH9mV2 PVC1o0T6NpBNpTo/7UShVny5UZuV3ZfGoXtYcfJI76ZXbSCGNKb+6iALlGMGOI9hhnGI YifJwmVlHP0sPidKNrfbrYyZ0D8oIZTdxm/i830QSSx1qR8WVJTeoTVxbdchV3ULuqPl 2VpI1bn6H8mQb3Q5agiKX8F4SoP2BNjtlz2HlAu+uB4B52wlLNAftNS5fyuPyk0Q52px klow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=N+3RJDq2ht15hSk6zYEj33Rmqj/GifGJwn2jV6Vb9+I=; b=Q7YzVtXrcecNs+TdLKqkC2ootCBO9pAFTmL6p5s1atU48NM6dM78vSksMVDQddh6Bu cvIt7PqfI74cxQeipOuefGAe5y+rE9Ejb6OA4uOHD22H2zB9rSom6jMxvPkY6ET9K//6 MADPQylpeNeKtZv14a1CFPrp/WDD74pQ9o7LBGfRR5l3JswdtRLbClO7RohjtRYObgdY A69xxe9Ifw+ovNgh/2OxAPUGT5v+/RbZojJpfBiX9p+BMxIAQbxL61UlEoL1a3jNmzLV Cfia02SasjDkbM4LX+f8JwpoNZjC78atO9Zsdksqf2zUJqc4N1fuSP/4J8UB2Gwsj6hv ogfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CDAvIh3y; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w5si2313071ote.129.2020.03.27.08.30.25; Fri, 27 Mar 2020 08:30:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CDAvIh3y; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727889AbgC0P3I (ORCPT + 99 others); Fri, 27 Mar 2020 11:29:08 -0400 Received: from us-smtp-delivery-74.mimecast.com ([63.128.21.74]:42207 "EHLO us-smtp-delivery-74.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727725AbgC0P3H (ORCPT ); Fri, 27 Mar 2020 11:29:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585322946; 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=N+3RJDq2ht15hSk6zYEj33Rmqj/GifGJwn2jV6Vb9+I=; b=CDAvIh3yrOFMddnQlFNTyksnbdWd2ewuTkkxkrJeOwzLFmaNCqH9+szUnlodx/m57Tooo8 AIKQ7/6BVoep/lF2ebPQZ2eo7ANXUE8+/JcPuGe3/AcvjJIoeKy5kr12kkczxsiJGFlBO5 sAjQ25WhALOWFhSWHmWwvEiXd8e3HjE= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-142-i5eKsjtROmmP4anlqK-faA-1; Fri, 27 Mar 2020 11:29:05 -0400 X-MC-Unique: i5eKsjtROmmP4anlqK-faA-1 Received: by mail-wr1-f71.google.com with SMTP id f8so4724121wrp.1 for ; Fri, 27 Mar 2020 08:29:05 -0700 (PDT) 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=N+3RJDq2ht15hSk6zYEj33Rmqj/GifGJwn2jV6Vb9+I=; b=qI19GmWXMM8RCn4WlO9u9528uiHKPoI43U9DftgnnoLJbdeZpZx65BlePgCoJv3JcJ e7SvW2+uHQPIP5yeA4KJ2xY0qFm1eKqlSEXBYriKgiV410EDVU69f9Po1Y/Etv4/yiq8 Qe1e6zcJbv3AR+Pudyu8eBYkXVNmP9Ixoq9Go+8Mrp2SO5ZBj5OrsDhi2SVsh4xXtYGV r3bCH9/liqT0l0rZiSPbR+lA3kpWdlpBCm1CK+EgrtQCfbJtQ0jlbfCkbudiGJtDqhd/ dPfmc6kGVMQvlsHyn9pc86rnAiYBfdSWP5OzTLfsM5MJ3XWKC3+P9jEUwngDaiXnR3tB 1OYw== X-Gm-Message-State: ANhLgQ2cEqv3ghknLpu7hpuWnLkwr2VYKQFwjjD4pIjfYxXZcDRV64ug c+HE+3NAblozPffn/FbNnVxoWkB2/B+WsuqQ3lHLIAU+VpMItpEx4/pke8zF0xBeIEuEXii8b4N ASrU9NrwbpfTYQ24529H1hTPJ X-Received: by 2002:a1c:ac8a:: with SMTP id v132mr5685975wme.62.1585322943488; Fri, 27 Mar 2020 08:29:03 -0700 (PDT) X-Received: by 2002:a1c:ac8a:: with SMTP id v132mr5685960wme.62.1585322943300; Fri, 27 Mar 2020 08:29:03 -0700 (PDT) Received: from redfedo.redhat.com ([2a01:cb14:58d:8400:ecf6:58e2:9c06:a308]) by smtp.gmail.com with ESMTPSA id i8sm8906856wrb.41.2020.03.27.08.28.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Mar 2020 08:29:01 -0700 (PDT) From: Julien Thierry To: linux-kernel@vger.kernel.org Cc: jpoimboe@redhat.com, peterz@infradead.org, raphael.gault@arm.com, Julien Thierry Subject: [PATCH v2 04/10] objtool: check: Ignore empty alternative groups Date: Fri, 27 Mar 2020 15:28:41 +0000 Message-Id: <20200327152847.15294-5-jthierry@redhat.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200327152847.15294-1-jthierry@redhat.com> References: <20200327152847.15294-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 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 74353b2c39ce..5c03460f1f07 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -904,6 +904,12 @@ static int add_special_section_alts(struct objtool_file *file) } if (special_alt->group) { + if (!special_alt->orig_len) { + WARN_FUNC("empty alternative entry", + orig_insn->sec, orig_insn->offset); + continue; + } + ret = handle_group_alt(file, special_alt, orig_insn, &new_insn); if (ret) -- 2.21.1