Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp576299ybb; Wed, 1 Apr 2020 05:54:48 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtAfzT7Ub8GSUO8HX411d9iekHCWtgnyolkZWbHmBbAOiqA4hmQDA0Y0bXMPAGVewKxVGCO X-Received: by 2002:a9d:4c8a:: with SMTP id m10mr16816221otf.114.1585745687947; Wed, 01 Apr 2020 05:54:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585745687; cv=none; d=google.com; s=arc-20160816; b=arruWMs/Rg9T8TwfHknyz/Rbuw5R0R6G5EKeFsWtL7m2KT/fRMwysDdKn7dHmRacx7 lAltcz59olL9jNyJZ7k4xJ8R1RS5SpKWH8PHN/TOcnnkLvdYNyRgJLdmwM+1UuPe3frI RbaRVQWbNBrvwG8bLeos1PNgP+dvEwOrfu+Wp1yz+wyYQAwZWk6MrpS4JrggI87fEzfC f1R3APWUPFsIXUMLyvOOgXgJ0TVZSm7oGKtc0hjO/OcJsPpy/Dzn/kkskEVFt7CUeMQv lRoYuwu9SrSbEjJuz2rKLFqOdTo85qc6exmqbU00HXrQZaUtkDGQ9dmbSyCUTO0JBBGN uO9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=j7RKHglz/jOPbyS+80tUx6vyYZ2N/cjy4CYWvpMTb80=; b=bG3wdlR7YKTtZzBMVGRy1NcYV9NS7phbZqe3u8/suMn/6HVK5zx98dCNUTUNQOYZfm 1XZd3a8dN7jR9DxYXcE3J95If/T/H1WGRbdFOQkzlL0NrN7ylzXLFdV7ZyZsyN4ioMPK kuotFgis0SjkYwS/w2AnC2htXgc/DQ6NM6hGN2JoNp+DYYrdJRH3c5UGr+kHX/f+DxfF 3GedW279JIe9uSbDIvtt66pNg3Gp3wGM0roaWsFe7vPtPxR4cNxFU7R0fFFPE7MONLQ+ Ls/4V4pX3vWX9mYF2ghIHZWqdeY8SdMpqKqKUDBluBefzACkeQMUA3cU+8d2qzmHLoU/ s1hg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x2si884638oix.42.2020.04.01.05.54.35; Wed, 01 Apr 2020 05:54:47 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732642AbgDAMxo (ORCPT + 99 others); Wed, 1 Apr 2020 08:53:44 -0400 Received: from mx2.suse.de ([195.135.220.15]:57064 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732490AbgDAMxn (ORCPT ); Wed, 1 Apr 2020 08:53:43 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id D5D0CAC5F; Wed, 1 Apr 2020 12:53:42 +0000 (UTC) Date: Wed, 1 Apr 2020 14:53:42 +0200 (CEST) From: Miroslav Benes To: Julien Thierry cc: linux-kernel@vger.kernel.org, jpoimboe@redhat.com, peterz@infradead.org, raphael.gault@arm.com Subject: Re: [PATCH v2 04/10] objtool: check: Ignore empty alternative groups In-Reply-To: <20200327152847.15294-5-jthierry@redhat.com> Message-ID: References: <20200327152847.15294-1-jthierry@redhat.com> <20200327152847.15294-5-jthierry@redhat.com> User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 27 Mar 2020, Julien Thierry wrote: > 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) Probably the first time I am looking at alternatives handling in objtool, so I must be missing something, but is this even possible now? I mean get_alt_entry() in special.c sets alt->orig_len when alt->group is true (which means .alternatives section) to something which cannot be zero. Is this a preparatory patch for arm64, where this could happen? If yes, it would be better to mention it in the changelog. Miroslav