btf: fix sanitization if BTF_FUNC_GLOBAL is not supported

The lower 16 bits were not actually being cleared.
pull/174/head
Alessandro Decina 3 years ago
parent b45a160bb0
commit 7ad0524283

@ -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));

Loading…
Cancel
Save