From 7e3bd60dd6c8f783f5a418c64aa75f6818236dc4 Mon Sep 17 00:00:00 2001 From: Taras Madan Date: Fri, 28 Feb 2025 13:57:50 +0100 Subject: pkg/symbolizer: introduce Symbolizer interface To simplify interface Read*Symbols were moved out from symbolizer.Symbolizer. --- tools/syz-check/check.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'tools/syz-check') diff --git a/tools/syz-check/check.go b/tools/syz-check/check.go index f42512c02..f153db6d1 100644 --- a/tools/syz-check/check.go +++ b/tools/syz-check/check.go @@ -110,7 +110,7 @@ func check(OS, arch, obj string, dwarf, netlink bool) ([]Warn, error) { warnings = append(warnings, warnings2...) } if netlink { - warnings3, err := checkNetlink(OS, arch, obj, structTypes, locs) + warnings3, err := checkNetlink(arch, obj, structTypes, locs) if err != nil { return nil, err } @@ -372,7 +372,7 @@ func parseDescriptions(OS, arch string) ([]prog.Type, map[string]*ast.Struct, [] // Then read in the symbol data, which is an array of nla_policy structs. // These structs allow to easily figure out type/size of attributes. // Finally we compare our descriptions with the kernel policy description. -func checkNetlink(OS, arch, obj string, structTypes []prog.Type, +func checkNetlink(arch, obj string, structTypes []prog.Type, locs map[string]*ast.Struct) ([]Warn, error) { if arch != targets.AMD64 { // Netlink policies are arch-independent (?), @@ -388,8 +388,7 @@ func checkNetlink(OS, arch, obj string, structTypes []prog.Type, if rodata == nil { return nil, fmt.Errorf("object file %v does not contain .rodata section", obj) } - symb := symbolizer.NewSymbolizer(targets.Get(OS, arch)) - symbols, err := symb.ReadRodataSymbols(obj) + symbols, err := symbolizer.ReadRodataSymbols(obj) if err != nil { return nil, err } -- cgit mrf-deployment