Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7652CC433EF for ; Fri, 15 Apr 2022 15:34:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355396AbiDOPgh (ORCPT ); Fri, 15 Apr 2022 11:36:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350086AbiDOPgR (ORCPT ); Fri, 15 Apr 2022 11:36:17 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B813DBD04 for ; Fri, 15 Apr 2022 08:31:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=P3phlzt2jlrzKklsHYn1TfxCDbD10BWcU2Svlrsg/wQ=; b=CsujisebCIp4oeeYFySgsDa/kF 2aBONQhPBQIwW7dx4mI1DI0nw53gqyYpstt3xpIc5RQqdBkApE5Jl0rRK7ip573OiiFHXP6DV7jcJ SoiOWHJCT1/xd2C9Y83LU8EGtMk1GyynYKbIci7gWiuDI1CVmxUNARu2wPxr7CIZLuBvXtGbVLC6Y xmypDReCztwbpfCpcyMQmQwfaAk2M1aZwrs6/h8O7dfCDkSScT7G/2T1RESfAdQDGp0jern0JP3tg OzL72bj3xDrP/tSQGjjs7R3vIbg7/6nN/NdJE8RohJd3CWixwcHj62cCZ3jCcU+6vQHUKbbQlCqJE fxJqJw/w==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nfNuo-00GEJv-Gr; Fri, 15 Apr 2022 15:31:18 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 96FEE9861A3; Fri, 15 Apr 2022 17:31:16 +0200 (CEST) Date: Fri, 15 Apr 2022 17:31:16 +0200 From: Peter Zijlstra To: Steven Rostedt Cc: x86@kernel.org, Josh Poimboeuf , hjl.tools@gmail.com, ndesaulniers@google.com, mbenes@suse.cz, linux-toolchains@vger.kernel.org Subject: Re: The trouble with __weak and objtool got worse Message-ID: <20220415153116.GB2731@worktop.programming.kicks-ass.net> References: <20220415101217.2ea62984@rorschach.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220415101217.2ea62984@rorschach.local.home> Precedence: bulk List-ID: X-Mailing-List: linux-toolchains@vger.kernel.org On Fri, Apr 15, 2022 at 10:12:17AM -0400, Steven Rostedt wrote: > On Fri, 15 Apr 2022 13:19:04 +0200 > Peter Zijlstra wrote: > > > This problem affects everything where we have external tools (mostly > > objtool but possible also recordmcount) generate location sections for > > us, notably things like: > > > > .static_call_sites > > .retpoline_sites > > __mcount_loc > > .orc_unwind > > .orc_unwind_ip > > But this is only an issue with newer compilers/linkers right? For the > case of recordmcount(), that is done pretty much entirely via the > compiler these days, so it is likely not an issue. We probably need to > have a way to tell the compiler about external references. Or perhaps > have an external tool to look at the weak functions that are overridden > and be able to handle it appropriately? It is possible to run an ancient compiler without -mrecord-mcount on a binutils version that strips unused symbols, at which point recordmcount will go funny too. Somewhat unlikely, but quite possible. Anyway, it seems the solution is to use one less '-' than I tried this morning.