|
|
@ -412,7 +412,6 @@ impl Btf {
|
|
|
|
features: &BtfFeatures,
|
|
|
|
features: &BtfFeatures,
|
|
|
|
) -> Result<(), BtfError> {
|
|
|
|
) -> Result<(), BtfError> {
|
|
|
|
let mut types = mem::take(&mut self.types);
|
|
|
|
let mut types = mem::take(&mut self.types);
|
|
|
|
|
|
|
|
|
|
|
|
for i in 0..types.types.len() {
|
|
|
|
for i in 0..types.types.len() {
|
|
|
|
let t = &types.types[i];
|
|
|
|
let t = &types.types[i];
|
|
|
|
let kind = t.kind();
|
|
|
|
let kind = t.kind();
|
|
|
@ -536,7 +535,6 @@ impl Btf {
|
|
|
|
let enum_type = BtfType::Enum(Enum::new(ty.name_offset, members));
|
|
|
|
let enum_type = BtfType::Enum(Enum::new(ty.name_offset, members));
|
|
|
|
types.types[i] = enum_type;
|
|
|
|
types.types[i] = enum_type;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Sanitize FUNC
|
|
|
|
// Sanitize FUNC
|
|
|
|
BtfType::Func(ty) => {
|
|
|
|
BtfType::Func(ty) => {
|
|
|
|
let name = self.string_at(ty.name_offset)?;
|
|
|
|
let name = self.string_at(ty.name_offset)?;
|
|
|
@ -562,22 +560,7 @@ impl Btf {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
types.types[i] = BtfType::Func(fixed_ty);
|
|
|
|
types.types[i] = BtfType::Func(fixed_ty);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Sanitize BTF_FUNC_GLOBAL and memset, memcpy
|
|
|
|
|
|
|
|
/*let name = self.string_at(ty.name_offset)?;
|
|
|
|
|
|
|
|
if !features.btf_func_global || name == "memset" || name == "memcpy" {
|
|
|
|
|
|
|
|
let mut fixed_ty = ty.clone();
|
|
|
|
|
|
|
|
if ty.linkage() == FuncLinkage::Global {
|
|
|
|
|
|
|
|
debug!(
|
|
|
|
|
|
|
|
"{}: BTF_FUNC_GLOBAL not supported. replacing with BTF_FUNC_STATIC",
|
|
|
|
|
|
|
|
kind
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
fixed_ty.set_linkage(FuncLinkage::Static);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
types.types[i] = BtfType::Func(fixed_ty);
|
|
|
|
|
|
|
|
}*/
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Sanitize FLOAT
|
|
|
|
// Sanitize FLOAT
|
|
|
|
BtfType::Float(ty) if !features.btf_float => {
|
|
|
|
BtfType::Float(ty) if !features.btf_float => {
|
|
|
|
debug!("{}: not supported. replacing with STRUCT", kind);
|
|
|
|
debug!("{}: not supported. replacing with STRUCT", kind);
|
|
|
|