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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1CEF5C433EF for ; Fri, 15 Apr 2022 18:30:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236241AbiDOScx (ORCPT ); Fri, 15 Apr 2022 14:32:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346786AbiDOScn (ORCPT ); Fri, 15 Apr 2022 14:32:43 -0400 Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A00015715D for ; Fri, 15 Apr 2022 11:30:14 -0700 (PDT) Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 23FIMU6Q029161; Fri, 15 Apr 2022 13:22:30 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 23FIMTJV029160; Fri, 15 Apr 2022 13:22:29 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Fri, 15 Apr 2022 13:22:29 -0500 From: Segher Boessenkool To: Peter Zijlstra Cc: x86@kernel.org, Josh Poimboeuf , hjl.tools@gmail.com, ndesaulniers@google.com, mbenes@suse.cz, rostedt@goodmis.org, linux-toolchains@vger.kernel.org Subject: Re: The trouble with __weak and objtool got worse Message-ID: <20220415182229.GB25951@gate.crashing.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Precedence: bulk List-ID: X-Mailing-List: linux-toolchains@vger.kernel.org Hi! On Fri, Apr 15, 2022 at 01:19:04PM +0200, Peter Zijlstra wrote: [ huge snip ] > This seems to happen when objtool cannot find a section symbol, in which > case it falls back to any other symbol to key off of, however in this > case that goes terribly wrong! That is an objtool problem then. Fix objtool so it looks at symbols directly? > The other option seems to be to have objtool add section symbols it > needs, however due to ELF being a total PITA and requiring all LOCAL > symbols to be before GLOBAL symbols, this would mean re-ordering the > whole symbol table (I have the code somewhere :-/). ELF requires no such thing? Where do you see this? This is the order you get as output from GNU LD, is that what you mean? Expecting a specific order when there is in fact total freedom is not a PITA, it is just the cost of doing business :-) > Alternatively: > > https://sourceware.org/pipermail/binutils/2020-December/114671.html > > seems to suggest: -Wa,--generate-unused-section-symbols=yes, ought to > work, except I'm getting: That email is for a proposed patch. Did anything further ever happen with it? Segher