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 3CC66C433F5 for ; Fri, 29 Apr 2022 21:08:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229489AbiD2VLu (ORCPT ); Fri, 29 Apr 2022 17:11:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239281AbiD2VKR (ORCPT ); Fri, 29 Apr 2022 17:10:17 -0400 Received: from mail-yw1-x112b.google.com (mail-yw1-x112b.google.com [IPv6:2607:f8b0:4864:20::112b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A96AB90CD6 for ; Fri, 29 Apr 2022 14:06:58 -0700 (PDT) Received: by mail-yw1-x112b.google.com with SMTP id 00721157ae682-2f7bb893309so97407327b3.12 for ; Fri, 29 Apr 2022 14:06:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=KKhtdiXBhaTQ4hxTf9h/JioXzWKd+xspA+ExR0T/yjc=; b=tEYpKdC2td7yT5/yYFiiREZeI36nhl7Oj+7G9V7HZsQ5hjWFZlrlWvC9CtOBXsK7ZG +mxtyGQArT6V7IqIIzXnAVBH72a9JR2JmZO2/9zObhJzg3/Cf7NYf6kBDQDV08PpWZnN uCAGISnBL0zGcCD1TVet1x69GS3xCNVIk+iBPXip5l5P6Foh4B5k/1MTG7b4HFzQreHJ /KpjzJFwM9kxulWQBu1uiOGKSLL3Nold5mQFzy+xylrcsJgsFhTSHIWH0xhqpmjxpHg1 rGQmRBH4nX7ie+KWJy4e6q5J/xul720DvSVfdM85td93O5XwB4NyW/kO7y+8+5mccw3/ /bMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=KKhtdiXBhaTQ4hxTf9h/JioXzWKd+xspA+ExR0T/yjc=; b=SmMOAIinWaXwEESaPllDlnIeHpTU/50rLvGor1XhyFHmRtHmW6oNMwf/bvOjxGB+BL KxQSGNeVMjjdEUgBcHGv99Vn+QmgCBYIcH72S1s4tWhZZwdoURQ1ht+TO2tTllEY9l4j oxFpQxoDPIPAzoxQ5kEa+lE2n47YtefVbG1JfERhjRYWFt+eqefBDEXkQHDZuZco7fo9 EKugOsTgJXOgA/WhmoiJLC71Xhd2Y6PGyIUmB6uhEN6Xs1lpkSlJ7+PN6qLkdQHgwA7M xXuw2anNNRNwGG2m/yaPUCf5N4LxIsYjBAl4ewZ6zybnbTY42f3fiLD8YHCB39UxbPFb hnww== X-Gm-Message-State: AOAM533PIFPpH6UDKbGX8OaZ6JJM14Zvje2tI+OhXeGkeBJ6IAy3unoK zPNFT9WgZtEvsU6unbCtXI35EcKN/LJM+LphMxqXKQ== X-Google-Smtp-Source: ABdhPJxLrWFyHTD9+YwHubc0aL0+LojL/hrWW7qjTOC9V3ofImDQAVpGOF5Q+KHyhkTEIPBduK6vYjBCmerUeNiRxq4= X-Received: by 2002:a81:5689:0:b0:2f7:c73a:1724 with SMTP id k131-20020a815689000000b002f7c73a1724mr1235585ywb.299.1651266417783; Fri, 29 Apr 2022 14:06:57 -0700 (PDT) MIME-Version: 1.0 References: <20220429091859.GS2731@worktop.programming.kicks-ass.net> <20220429201249.5hjcutds4wmkhemr@treble> In-Reply-To: <20220429201249.5hjcutds4wmkhemr@treble> From: =?UTF-8?B?RsSBbmctcnXDrCBTw7JuZw==?= Date: Fri, 29 Apr 2022 14:06:46 -0700 Message-ID: Subject: Re: [PATCH] linkage: Fix issue with missing symbol size To: Josh Poimboeuf Cc: Peter Zijlstra , x86@kernel.org, mark.rutland@arm.com, linux-kernel@vger.kernel.org, linux-toolchains@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-toolchains@vger.kernel.org On Fri, Apr 29, 2022 at 1:13 PM Josh Poimboeuf wrote: > > On Fri, Apr 29, 2022 at 11:18:59AM +0200, Peter Zijlstra wrote: > > > > Occasionally, typically when a function doesn't end with 'ret', an > > alias on that function will have 0 size. > > > > The difference between what GCC generates and our linkage magic, is > > that GCC doesn't appear to provide .size for the alias'ed symbol at > > all. And indeed, removing this directive cures the issue. > > > > Additionally, GCC also doesn't emit .type for alias symbols either, so > > also omit that. > > > > Fixes: e0891269a8c2 ("linkage: add SYM_FUNC_ALIAS{,_LOCAL,_WEAK}()") > > Suggested-by: Mark Rutland > > Signed-off-by: Peter Zijlstra (Intel) > > Acked-by: Josh Poimboeuf > > -- > Josh > Yeah, an alias inherits the original symbol's st_size. In case you are interested in the internals, see https://sourceware.org/bugzilla/show_bug.cgi?id=29012 ("gas: .set should copy st_size only if src's st_size is unset")