Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3732767rwb; Tue, 16 Aug 2022 07:59:23 -0700 (PDT) X-Google-Smtp-Source: AA6agR5RpQJsHZoRmpsFRM/vuFnkEpWBom82X1yfH2+VtT9X/MKMnb2LzJFRIKT8zCkR4Y86BTK6 X-Received: by 2002:a05:6402:298a:b0:43a:76f8:a75c with SMTP id eq10-20020a056402298a00b0043a76f8a75cmr19572771edb.216.1660661962959; Tue, 16 Aug 2022 07:59:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660661962; cv=none; d=google.com; s=arc-20160816; b=Xg75792mP1ofF0iXfnb7nSu8T9Kuc7vXbnhUMgM+gaKdjvFKUdAw+iJ4+A5udn5/Gk 6jZxbwR8OFYX8iwxOuEjobmuDMPTJPcJ+2Nw3JDbFJKDEReTYgpuduizQOxQ1CZZPXvO c7eJs6HgoK4DzznAIJ6tEZeYDKTDsPydmMvfLSD9b5BJmVpLhzf69ILxucgzUWu4NFg1 yolv3LNdWIw0CVmH8NMQex/cUR15dFpLdasZV+pHSbxvYPMvbPt3yXHDRFep6YCZKdel FnZqcUVkuOUjv5lA1lLp0ATAORUUbMgNQtjiZ427Hg3EYpN3qTMjzuHyX12n/7khPy0G lKuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=iB2B5yr9EyZ/0/LP45XgIZgZUCWqNlpD6xdev+Q8Wvg=; b=GpGoVCM36Of53csR6YIUCXk3ZZ6bPklpP2B4Y/KGABSXLBb9fFtFB/gIDf3xlOC1oY TyTfSDml6wlDflRoqU8A30/11abZHlGaTkt3wyXV3sA9h/g2Z22GgnSc7fzYYmLBq2p8 N17SHbzzIiZMAr+JiulgCiPsxZJ9vfLEOob4k4dlaEmfho4/K7mSijdB0k2B0YXzG/k7 YQJtcjN8LUus0pRhqGMQTsJUQ1p9NrK982KEtr/9JhUCzR4pshZhLGrTSqBA5BQOu59i EXEGb3WZpRDbf1Z3V6x+ihp1+KCfbKOlwjxp8RF1Pj9Yag6Uclyr0BLNiilTzuk06OJV n/xA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hp10-20020a1709073e0a00b0073040248a76si10175265ejc.700.2022.08.16.07.58.54; Tue, 16 Aug 2022 07:59:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235878AbiHPOFr (ORCPT + 99 others); Tue, 16 Aug 2022 10:05:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235952AbiHPOEc (ORCPT ); Tue, 16 Aug 2022 10:04:32 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D76B86610C for ; Tue, 16 Aug 2022 07:04:19 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id B88A5B819C9 for ; Tue, 16 Aug 2022 14:04:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ACAB4C433C1; Tue, 16 Aug 2022 14:04:15 +0000 (UTC) Date: Tue, 16 Aug 2022 10:04:23 -0400 From: Steven Rostedt To: "Naveen N. Rao" Cc: Michael Ellerman , Nathan Chancellor , Nick Desaulniers , , , llvm@lists.linux.dev Subject: Re: [PATCH 0/2] ftrace/recordmcount: Handle object files without section symbols Message-ID: <20220816100423.5ee2e17c@gandalf.local.home> In-Reply-To: References: X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 27 Apr 2022 15:01:20 +0530 "Naveen N. Rao" wrote: > This solves a build issue on powerpc with binutils v2.36 and newer [1]. > Since commit d1bcae833b32f1 ("ELF: Don't generate unused section > symbols") [2], binutils started dropping section symbols that it thought > were unused. Due to this, in certain scenarios, recordmcount is unable > to find a non-weak symbol to generate a relocation record against. > > Clang integrated assembler is also aggressive in dropping section > symbols [3]. > > In the past, there have been various workarounds to address this. See > commits 55d5b7dd6451b5 ("initramfs: fix clang build failure") and > 6e7b64b9dd6d96 ("elfcore: fix building with clang") and a recent patch: > https://lore.kernel.org/linuxppc-dev/20220425174128.11455-1-naveen.n.rao@linux.vnet.ibm.com/T/#u > > Fix this issue by using the weak symbol in the relocation record. This > can result in duplicate locations in the mcount table if those weak > functions are overridden, so have ftrace skip dupicate entries. > > Objtool already follows this approach, so patch 2 updates recordmcount > to do the same. Patch 1 updates ftrace to skip duplicate entries. > > - Naveen > > > [1] https://github.com/linuxppc/issues/issues/388 > [2] https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=d1bcae833b32f1 > [3] https://github.com/ClangBuiltLinux/linux/issues/981 > > There's been work to handle weak functions, but I'm not sure that work handled the issues here. Are these patches still needed, or was there another workaround to handle the problems this addressed? -- Steve