From patchwork Sat May 8 15:22:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaldo Carvalho de Melo X-Patchwork-Id: 12246083 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNWANTED_LANGUAGE_BODY autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 487CDC433B4 for ; Sat, 8 May 2021 15:22:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 17E4761155 for ; Sat, 8 May 2021 15:22:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229552AbhEHPXR (ORCPT ); Sat, 8 May 2021 11:23:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:55126 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229544AbhEHPXR (ORCPT ); Sat, 8 May 2021 11:23:17 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9919061155; Sat, 8 May 2021 15:22:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1620487335; bh=1Jpp0mNVX3vrMiyD9zJICNyxEYv/4w8Z8fZcO/gNx2U=; h=Date:From:To:Cc:Subject:From; b=T8WSCXLHwM8iEN0msYdUaxbDh7VSzM+7QLwfdwtbfiXn/Wd76/YBnF26qnCU6pvDO Gcqt8UXBRCiUwGetS3XJ5dXVw+83t1Qz5c4fWrW/xTSUexfCkYVGr7LgMgPri004DE A3TXFV4NW9sdcwQSZwdJyR/CpFwtON5zBF4tOJqybxtSZPUgnqritUPHYZAEkXtLEz l2vhmd+V8/oUtQG9FbJ2Q7QRMywLGj8DOTLe5ProKZLE1iVh6Mnt2vbBQwGjSBZXnj d6mtlEz5qQhOLjJX47P9RwsxHeGpqYsMb0aGwgurKSpJVgZB9tMzERtkmJ8SGYKH3N yGrKuSJamUSAQ== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id AE1C24034C; Sat, 8 May 2021 12:22:12 -0300 (-03) Date: Sat, 8 May 2021 12:22:12 -0300 From: Arnaldo Carvalho de Melo To: Andrii Nakryiko Cc: Alexei Starovoitov , Jiri Olsa , David Miller , bpf@vger.kernel.org Subject: [PATCH 1/1] libbpf: Provide GELF_ST_VISIBILITY() define for older libelf Message-ID: MIME-Version: 1.0 Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net Where that macro isn't available. Cc: Alexei Starovoitov Cc: Andrii Nakryiko Cc: Jiri Olsa Signed-off-by: Arnaldo Carvalho de Melo --- tools/lib/bpf/libbpf_internal.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/lib/bpf/libbpf_internal.h b/tools/lib/bpf/libbpf_internal.h index ee426226928f1283..acbcf6c7bdf82cf2 100644 --- a/tools/lib/bpf/libbpf_internal.h +++ b/tools/lib/bpf/libbpf_internal.h @@ -41,6 +41,11 @@ #define ELF_C_READ_MMAP ELF_C_READ #endif +/* Older libelf all end up in this expression, for both 32 and 64 bit */ +#ifndef GELF_ST_VISIBILITY +#define GELF_ST_VISIBILITY(o) ((o) & 0x03) +#endif + #define BTF_INFO_ENC(kind, kind_flag, vlen) \ ((!!(kind_flag) << 31) | ((kind) << 24) | ((vlen) & BTF_MAX_VLEN)) #define BTF_TYPE_ENC(name, info, size_or_type) (name), (info), (size_or_type)