Parcourir la source

Merge pull request #174 from alessandrod/func-global-fix

btf: fix sanitization if BTF_FUNC_GLOBAL is not supported
Dave Tucker il y a 3 ans
Parent
commit
f70ab2caa7
1 fichiers modifiés avec 2 ajouts et 1 suppressions
  1. 2 1
      aya/src/obj/btf/btf.rs

+ 2 - 1
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));