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=-6.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 B1F3FC4363A for ; Wed, 21 Oct 2020 21:30:00 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 30AA7221F9 for ; Wed, 21 Oct 2020 21:30:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="lL1FMDwI"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="J76nDGVI" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 30AA7221F9 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+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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ijF5Wi6g2/1J1BcRhbSiYuSqEtsKFjIygpSnG1hG8lg=; b=lL1FMDwInjqAJRR/zYq5n6tyH vcVjpVsYDocrWQDn3ACWsY20Y6LX69WwSbYz/gU/c//AoUbWCeti0ZiBxicgBROZOOsig/HhoiF6S UrkDKgv+2CFsWPgEsOq3YUhBKhOfPl3DgpaSoOej6co/VZd2VJGG2Iy8dk3LJqIpTQamajrpRXvci +/2kV6lcWiJkR7clEKDrt0Gmchr0AUYpj+0lSoupR3AFIcRl6qisIimGs4N4NKx0gSlo1JKuOR3np GwuAyFZCfTM92gjr0HfMMhzSg5oqVxCGOKVAz7odVIJTDz1Eb6Nad5Qi+5zAbrx/Kfn8Lt8xPnBe+ yE/pcQidw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kVLeO-0000aY-Jv; Wed, 21 Oct 2020 21:28:04 +0000 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kVLeM-0000a1-4g for linux-arm-kernel@lists.infradead.org; Wed, 21 Oct 2020 21:28:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603315681; 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: in-reply-to:in-reply-to:references:references; bh=npHB1hy+ohfvs54PXo0mWCyiDRitVB3e4369uMWtO3E=; b=J76nDGVIukA6uMeyl3dsBnuKUJyI8WyhAwV4xrdXkcLuC2XZHHEzh0pozoXIsdru68hxNA fW4nBvQ7V5TeDZOrf1PEK+bR3f44uYbwrfX3nthM4l8RWYszlBQ+CRJRJIXhsn+SnBKfZN rjWsxBtqH70UpNb7BcyeYUbcdqr+jTQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-584-YOTFvTwkO0i9giCn_eXxEQ-1; Wed, 21 Oct 2020 17:27:57 -0400 X-MC-Unique: YOTFvTwkO0i9giCn_eXxEQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C48045708C; Wed, 21 Oct 2020 21:27:54 +0000 (UTC) Received: from treble (ovpn-115-237.rdu2.redhat.com [10.10.115.237]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 799F855760; Wed, 21 Oct 2020 21:27:50 +0000 (UTC) Date: Wed, 21 Oct 2020 16:27:47 -0500 From: Josh Poimboeuf To: Peter Zijlstra Subject: Re: [PATCH v6 22/25] x86/asm: annotate indirect jumps Message-ID: <20201021212747.ofk74lugt4hhjdzg@treble> References: <20201013003203.4168817-1-samitolvanen@google.com> <20201013003203.4168817-23-samitolvanen@google.com> <20201015102216.GB2611@hirez.programming.kicks-ass.net> <20201015203942.f3kwcohcwwa6lagd@treble> <20201020185217.ilg6w5l7ujau2246@treble> <20201021085606.GZ2628@hirez.programming.kicks-ass.net> <20201021093213.GV2651@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201021093213.GV2651@hirez.programming.kicks-ass.net> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201021_172802_239747_0B4D68FE X-CRM114-Status: GOOD ( 18.35 ) 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: linux-arch , Kees Cook , "Paul E. McKenney" , Jann Horn , Greg Kroah-Hartman , Masahiro Yamada , the arch/x86 maintainers , Nick Desaulniers , kernel list , Steven Rostedt , linux-kbuild , clang-built-linux , Sami Tolvanen , linux-pci@vger.kernel.org, Kernel Hardening , Will Deacon , Linux ARM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Oct 21, 2020 at 11:32:13AM +0200, Peter Zijlstra wrote: > On Wed, Oct 21, 2020 at 10:56:06AM +0200, Peter Zijlstra wrote: > > > I do not see these in particular, although I do see a lot of: > > > > "sibling call from callable instruction with modified stack frame" > > defconfig-build/vmlinux.o: warning: objtool: msr_write()+0x10a: sibling call from callable instruction with modified stack frame > defconfig-build/vmlinux.o: warning: objtool: msr_write()+0x99: (branch) > defconfig-build/vmlinux.o: warning: objtool: msr_write()+0x3e: (branch) > defconfig-build/vmlinux.o: warning: objtool: msr_write()+0x0: <=== (sym) > > $ nm defconfig-build/vmlinux.o | grep msr_write > 0000000000043250 t msr_write > 00000000004289c0 T msr_write > 0000000000003056 t msr_write.cold > > Below 'fixes' it. So this is also caused by duplicate symbols. There's a new linker flag for renaming duplicates: https://sourceware.org/bugzilla/show_bug.cgi?id=26391 But I guess that doesn't help us now. I don't have access to GCC 10 at the moment so I can't recreate it. Does this fix it? diff --git a/tools/objtool/elf.c b/tools/objtool/elf.c index 4e1d7460574b..aecdf25b2381 100644 --- a/tools/objtool/elf.c +++ b/tools/objtool/elf.c @@ -217,11 +217,14 @@ struct symbol *find_func_containing(struct section *sec, unsigned long offset) return NULL; } +#define for_each_possible_sym(elf, name, sym) \ + elf_hash_for_each_possible(elf->symbol_name_hash, sym, name_hash, str_hash(name)) + struct symbol *find_symbol_by_name(const struct elf *elf, const char *name) { struct symbol *sym; - elf_hash_for_each_possible(elf->symbol_name_hash, sym, name_hash, str_hash(name)) + for_each_possible_sym(elf, name, sym) if (!strcmp(sym->name, name)) return sym; @@ -432,6 +435,8 @@ static int read_symbols(struct elf *elf) list_for_each_entry(sym, &sec->symbol_list, list) { char pname[MAX_NAME_LEN + 1]; size_t pnamelen; + struct symbol *psym; + if (sym->type != STT_FUNC) continue; @@ -454,8 +459,14 @@ static int read_symbols(struct elf *elf) strncpy(pname, sym->name, pnamelen); pname[pnamelen] = '\0'; - pfunc = find_symbol_by_name(elf, pname); - + pfunc = NULL; + for_each_possible_sym(elf, pname, psym) { + if ((!psym->cfunc || psym->cfunc == psym) && + !strcmp(psym->name, pname)) { + pfunc = psym; + break; + } + } if (!pfunc) { WARN("%s(): can't find parent function", sym->name); _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel