Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1212759rwl; Wed, 12 Apr 2023 09:38:14 -0700 (PDT) X-Google-Smtp-Source: AKy350YMs7vQx1j1t2ISsk9RGizYaVZ6CSFjLrL09fuDXE7t4ZGulG/OdSDUQz0oN2VNoPYhP84I X-Received: by 2002:aa7:9f05:0:b0:63a:8533:d6a7 with SMTP id g5-20020aa79f05000000b0063a8533d6a7mr9107464pfr.9.1681317494638; Wed, 12 Apr 2023 09:38:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681317494; cv=none; d=google.com; s=arc-20160816; b=ghti/VUCZ0oG5IsFwERiM0pinOU6BmaPPaKJzX8N5gMpB02xQfl3CjeIdi5XA0r4nM DLBygBrR5MDCGMXr3gFHwnwi7Kwl6BPsha6QJ82bfBR9RQLQ7gPJentErXn4n4myj5Kw t8+HibET5J4PK5aacBNkxzJt2OZo7wXe2SHa/qShGcfchRHgUPVRwvAdCy8oDVHm1Ji9 d9JPlyUlQQ05/YJE8lCIUg0arznTCltMetLBwzQAcIxPwYZ4bMxt3TOvCi20cK8rqZUb nPrH9s3+W93iHTDH9GXY/Q9X2klvrpEJP1U55qmHXPtU2Kj+4NmEZo1WwnMbE8dRNjrY E0nA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=pUEOBqA8gdprAY9XDedFhhDjUwzSGArvscXJn3X69Ys=; b=yy9krEAhLKvJENAfHe0GJNEqbmn+LZ9vOyrgZ7fEyUM/ukcqQiRYeDjLIWDR9q1qfC MRBg/ZFQIbQTSqKXExyP/C/3/Y+ORXDeGxbH3kU6QWmUr4IzFzg6biHCHdWFm/fR4Syn 3sS+dwN/532UVMLniDmOFoCxR0kRECKQLIsGCgGfP5c4LkLMKdgUxFhIHVz3lOps82TN pmzd7HP6IZLUgrfyaqxZ7EFNHS1d60XQmlC8puRur2R1X2u7CfW3yhLEXZ2fepoEOb8f 5flbDDqdZM84qn17mQPmYtdaKlVZzT4goqBPDOoteSzVedQHZZ1jHUgM1b8F7gYbq8ts o7JQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hRbRHWLl; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e22-20020aa79816000000b0063aed85c989si5221451pfl.71.2023.04.12.09.38.00; Wed, 12 Apr 2023 09:38:14 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hRbRHWLl; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229832AbjDLQaW (ORCPT + 99 others); Wed, 12 Apr 2023 12:30:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229482AbjDLQaV (ORCPT ); Wed, 12 Apr 2023 12:30:21 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5278D4228; Wed, 12 Apr 2023 09:30:20 -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 dfw.source.kernel.org (Postfix) with ESMTPS id CC1B762D59; Wed, 12 Apr 2023 16:30:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B3871C433EF; Wed, 12 Apr 2023 16:30:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1681317019; bh=xr8xMxEDBkUnuwk9S5+wT+dGX4efZJI50h6/870XpHI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hRbRHWLluhYDIaIvsIQXLloQQ/siu96TaNjy0ww5ksO0UlO9ktx1aSBDZFPu6iYtN dTvn5JH7nOVAYdF1HM+xlDaAigE69U8FxWtateOyDJWDAM8uMFqoTmRGQL8oYHBequ t2/UzX001+VmzJcVg8enNLaEFrhPmQn2fZNFCmcPSp1AS0IWAdu6LgqX1Yt8mG7hBt kM5Q+JvrI6HfpWan8u33h/DhGBPAjf+4xPzD+OdO5K71FW0lCN0Jdz5GF4pbJmMyWu xZB+QXmFOioMeDdg3Gq0o5uYHXvBa/wUdXC2yVdUK6muNx/YjZBBgGQu+lDePTOZ6J AODuyRJAYJAYw== Date: Wed, 12 Apr 2023 09:30:16 -0700 From: Josh Poimboeuf To: Tianyi Liu Cc: acme@kernel.org, alan.maguire@oracle.com, alexandref75@gmail.com, bpf@vger.kernel.org, dxu@dxuuu.xyz, jforbes@redhat.com, linux-kernel@vger.kernel.org, olsajiri@gmail.com, peterz@infradead.org, ptalbert@redhat.com, yhs@fb.com Subject: Re: [PATCH] vmlinux.lds.h: Force-align ELF notes section to four bytes Message-ID: <20230412163016.5p7wve3meeahdecp@treble> References: <20230411170058.7677oximl7oq4hkv@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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, Apr 12, 2023 at 03:10:14PM +0800, Tianyi Liu wrote: > On Tue, Apr 11, 2023 at 17:00 , Josh Poimboeuf wrote: > > On Tue, Feb 14, 2023 at 02:33:02PM +0800, Tianyi Liu wrote: > > > > LLVM_OBJCOPY=objcopy pahole -J --btf_gen_floats -j > > > > --skip_encoding_btf_inconsistent_proto --btf_gen_optimized > > > > .tmp_vmlinux.btf > > > > btf_encoder__encode: btf__dedup failed! > > > > Failed to encode BTF > > > > > > > > Thanks, > > > > > > > > > > I encountered the same problem when building a new kernel and I found some > > > reasons for the error. > > > > > > In short, enabling CONFIG_X86_KERNEL_IBT will change the order of records in > > > .notes section. In addition, due to historical problems, the alignment of > > > records in the .notes section is not unified, which leads to the inability of > > > gelf_getnote() to read the records after the wrong one. > > > > Alexandre, Tianyi, are you still seeing this issue with the latest > > dwarves? If so can you confirm the below patch fixes it? > > > > Josh, first of all, thank you very much for your help. However, this patch > doesn't work in my environment. I am using gcc 12.2.1 20230201. > After compiling, when I use readelf -S to view ELF sections, > the align of .notes section is still 8: > > $ readelf -S .tmp_vmlinux.btf > [20] .notes NOTE ffffffff8250b570 0170b570 > 0000000000000084 0000000000000000 A 0 0 8 Hm, weird. > > Apparently the latest dwarves release fixes it on Fedora Rawhide [1], > > does anybody know if there a specific dwarves and/or libbpf change for > > this? > > > > It has been fixed in dwarves[1], but it may just be a coincidence. So just to confirm, the btf__dedup error is gone for you with the latest dwarves? -- Josh