Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3512712pxf; Mon, 15 Mar 2021 11:11:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwLD3g3ynt+QHFbRXGSKKBOiQaEC0QUvMCYdwtT/flqId76B3GkzWCc1S9sW1/YOzSqC+Hs X-Received: by 2002:a17:907:9862:: with SMTP id ko2mr24517988ejc.222.1615831889626; Mon, 15 Mar 2021 11:11:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615831889; cv=none; d=google.com; s=arc-20160816; b=eZjFuyIpqU3JuKc1d9axTetvrulC2WHEEmUyvGItDEgOCp3om/xCBEGu4bQFJZYfTQ Rh15mGBUQChbkFaki1TUdf77BfUSXMTiNJQD3dC1pLIcmTPlHc50biQj+rOvwm8zDs+c qk2F19IDXCQb6xXK2vKlAWQy2byBWB2aj2MsxuioYTyLHgFRFP/ZUgrlHfGp/MncS6E5 2FO6+MsS+myp3hrvBnbjM5VmCRNq+iGCl6DUKk5NMS5wBzUO4xuvzaxbLu1FQpxAyoIT iAmUJB9y0tmtCrd6V9oZidqnyhWHIrOcDmD5A2s3RrHEf0TZbL+p2Eio8ADtLXGi3cp1 2k2w== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=QtYcw/rW+hUQ0uN7HwcPesAqUo/sWyAG4Z+kDuBMS08=; b=DYjCTtwGLZJVaeVbLW5PGNwKnsev7JOerqLvDebGVEv02E76X8Iw6IIoWICo40OTM2 L7jSu/+3afu6Z4soqK05ut2wI/Af7up75pATznwOpxw/4/7Aw2WnPv3haFjKafo/0VNO /zb2Up6SoHENPF3cxnkU8+1vOnDifBHNpPJtQBugs7GBDAb43nZ013Dku6ntJNg61GHq UOyvGmpfnFwO5HxuWMHR5PJcUNE205Q1ICydFub3Q6SYWlsCeNa8cmM0GB4iI2rScSXw DaYJbeOLtqh2q0WkCY5EUe7ZLcIB1F4KcG9I/hpsh04pyJTaQ0B71rMfTn/7nqgUn2XQ lwtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Pj8YgrS/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b11si11942164edz.197.2021.03.15.11.11.00; Mon, 15 Mar 2021 11:11:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Pj8YgrS/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235841AbhCOOLW (ORCPT + 99 others); Mon, 15 Mar 2021 10:11:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:37836 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232169AbhCON6X (ORCPT ); Mon, 15 Mar 2021 09:58:23 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E42B664F12; Mon, 15 Mar 2021 13:58:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816701; bh=9CV0ZSnjWWhvIHdvkEWgDCT3NYALRwpERTnLsQQyn3k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Pj8YgrS/E4djL59U2zIyqRwA9YLVOpSQFW0M2D9mt7Gm30qoZTqppnQCISq959cYy WvsK34r658SRlxK0KSfXdX9kE6l19C0AHsc2ChvDLR5j0TUEVS+tk7RARtLfEMU+lg 5fkGyyDloZnvOXB6jRIO+BY0IwEVsba/ShOnY0qU= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kun-Chuan Hsieh , Daniel Borkmann , Jiri Olsa Subject: [PATCH 5.10 064/290] tools/resolve_btfids: Fix build error with older host toolchains Date: Mon, 15 Mar 2021 14:52:37 +0100 Message-Id: <20210315135544.077842633@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135541.921894249@linuxfoundation.org> References: <20210315135541.921894249@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Greg Kroah-Hartman From: Kun-Chuan Hsieh commit 41462c6e730ca0e63f5fed5a517052385d980c54 upstream. Older libelf.h and glibc elf.h might not yet define the ELF compression types. Checking and defining SHF_COMPRESSED fix the build error when compiling with older toolchains. Also, the tool resolve_btfids is compiled with host toolchain. The host toolchain is more likely to be older than the cross compile toolchain. Fixes: 51f6463aacfb ("tools/resolve_btfids: Fix sections with wrong alignment") Signed-off-by: Kun-Chuan Hsieh Signed-off-by: Daniel Borkmann Acked-by: Jiri Olsa Link: https://lore.kernel.org/bpf/20210224052752.5284-1-jetswayss@gmail.com Signed-off-by: Greg Kroah-Hartman --- tools/bpf/resolve_btfids/main.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/tools/bpf/resolve_btfids/main.c +++ b/tools/bpf/resolve_btfids/main.c @@ -258,6 +258,11 @@ static struct btf_id *add_symbol(struct return btf_id__add(root, id, false); } +/* Older libelf.h and glibc elf.h might not yet define the ELF compression types. */ +#ifndef SHF_COMPRESSED +#define SHF_COMPRESSED (1 << 11) /* Section with compressed data. */ +#endif + /* * The data of compressed section should be aligned to 4 * (for 32bit) or 8 (for 64 bit) bytes. The binutils ld