From 7ad0524283006fce221910df4c1817af503b5b61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alessandro=C2=A0Decina?= Date: Mon, 17 Jan 2022 08:45:57 +0000 Subject: [PATCH] btf: fix sanitization if BTF_FUNC_GLOBAL is not supported The lower 16 bits were not actually being cleared. --- aya/src/obj/btf/btf.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aya/src/obj/btf/btf.rs b/aya/src/obj/btf/btf.rs index 1b4bc3a7..92cb9c9c 100644 --- a/aya/src/obj/btf/btf.rs +++ b/aya/src/obj/btf/btf.rs @@ -596,7 +596,8 @@ impl Btf { "{}: BTF_FUNC_GLOBAL not supported. replacing with BTF_FUNC_STATIC", kind ); - ty.info |= (btf_func_linkage::BTF_FUNC_STATIC as u32) & 0xFFFF; + ty.info = (ty.info & 0xFFFF0000) + | (btf_func_linkage::BTF_FUNC_STATIC as u32) & 0xFFFF; btf.add_type(BtfType::Func(ty)); } else { btf.add_type(BtfType::Func(ty));