Skip to content

Commit d190dec

Browse files
committed
elf: turn BTF map_extra into ErrNotSupported
Seems like BTF map definitions have gained a map_extra field which we don't know how to handle. Return ErrNotSupported for now so that TestLibBPF can skip the test. Signed-off-by: Lorenz Bauer <[email protected]>
1 parent b8dc0ee commit d190dec

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

elf_reader.go

+3
Original file line numberDiff line numberDiff line change
@@ -972,6 +972,9 @@ func mapSpecFromBTF(es *elfSection, vs *btf.VarSecinfo, def *btf.Struct, spec *b
972972
return nil, fmt.Errorf("resolving values contents: %w", err)
973973
}
974974

975+
case "map_extra":
976+
return nil, fmt.Errorf("BTF map definition: field %s: %w", member.Name, ErrNotSupported)
977+
975978
default:
976979
return nil, fmt.Errorf("unrecognized field %s in BTF map definition", member.Name)
977980
}

0 commit comments

Comments
 (0)