Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3524039pxf; Mon, 15 Mar 2021 11:28:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJv5jw5B8y+EPLMzCkv3MovlOWLj2lLGsUGl8eYasq7Beayt9JaR1KSgMW5I9rzSfe4AVA X-Received: by 2002:a17:906:f203:: with SMTP id gt3mr9893774ejb.346.1615832888490; Mon, 15 Mar 2021 11:28:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615832888; cv=none; d=google.com; s=arc-20160816; b=nzB04t4HBZ3UxBOlbFbjLbkvwhGtDDwRrSCesghM9syBhDIktUfwcxmAjVCzCjMscf D+fw7nM+JksO6tbqsCMpxiBsAgkH8zUO8MjbEPN6TBFoR1l4RGB0B4lMf9runkT39phe NS60w5i3xxoUKeH3KttBDp/EtGdHX/GCfA6/DkN49dIdQ2kIhFaChv2h31bWGbN8ndId E+zUYPM+rdAmTN83gRauKoDisaecvF4WKAT8BNSoNV6sYAaL0FYhY1hKfzwGe4BHe8Dl Ia7qMUWZjqFTkBGHVXSVKWrwEx7GjaPgmKk7bzMO2htmGW6gRecLltfhgNcsbAgogxzG pGIA== 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=cI+Uqnd7wLcMIZb2FlQyoWxlFIs0A7rLifFyR4Jrn+4=; b=NS7SK1K5GKB7SePzCKvLk1501V+KxcYkbioFqgMRgnDnHclYv1E9vDgGuTepUPDzf4 eFbAn9sSJhrejSLUxKLYk4Di22qpdnQFLUN4MHnrHJJpiExJoBh7/1MBboLH4pk9OOwU 2kmaRkR1tzrGS6ng4TvzKrD/3fQSon4KQf/9u/8rjYfCuAmC3dE9RVA5Nl3Qoiz4+V63 aDRv0y6TJiS/QAt4wmDNMht4HCuZmmLgGb86ZzO58BLHS9KVGAph+QgmMSjMgIoFpUvI mtpYe87HJsy9EetkfgjS/L9cKjpHcP6HuaBHzWXCRUqeMNGVTNrWd3OImKShePh0Goaz pbNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lt6OgcWh; 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 s10si12063188ejv.67.2021.03.15.11.27.40; Mon, 15 Mar 2021 11:28:08 -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=lt6OgcWh; 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 S235210AbhCOOar (ORCPT + 99 others); Mon, 15 Mar 2021 10:30:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:37582 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231352AbhCON6k (ORCPT ); Mon, 15 Mar 2021 09:58:40 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A299A64DAD; Mon, 15 Mar 2021 13:58:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816710; bh=0LN11zS0FSbgEzCqHfpzG5XxRooqU9F/ssw+YelPXWo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lt6OgcWhJxTbZKLq8/sPrv+QXZmulgxvfs4UASSBhoGuACJ1oRroQXqHLHhKJaIID hGA7DJMa1DThiv04dhOYRAzx4SjU/wFzUzIu4TVz7X7IlaLizhxGM+MmhmliYQ2cMH ouIQLRdicGHDN7yUXkaeI5pNecm29jDWl48s8x+U= 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.11 078/306] tools/resolve_btfids: Fix build error with older host toolchains Date: Mon, 15 Mar 2021 14:52:21 +0100 Message-Id: <20210315135510.275986662@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135507.611436477@linuxfoundation.org> References: <20210315135507.611436477@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 @@ -260,6 +260,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