MCPcopy
hub / github.com/cilium/ebpf / loadVersion

Function loadVersion

elf_reader.go:226–236  ·  view source on GitHub ↗
(sec *elf.Section, bo binary.ByteOrder)

Source from the content-addressed store, hash-verified

224}
225
226func loadVersion(sec *elf.Section, bo binary.ByteOrder) (uint32, error) {
227 if sec == nil {
228 return 0, nil
229 }
230
231 var version uint32
232 if err := binary.Read(sec.Open(), bo, &version); err != nil {
233 return 0, fmt.Errorf("section %s: %v", sec.Name, err)
234 }
235 return version, nil
236}
237
238func isDataSection(name string) bool {
239 return name == ".bss" || strings.HasPrefix(name, ".data") || strings.HasPrefix(name, ".rodata")

Callers 1

Calls 2

OpenMethod · 0.80
ReadMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…