MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ELFSymbol

Class ELFSymbol

dpdk/buildtools/pmdinfogen.py:23–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21
22
23class ELFSymbol:
24 def __init__(self, image, symbol):
25 self._image = image
26 self._symbol = symbol
27
28 @property
29 def string_value(self):
30 size = self._symbol["st_size"]
31 value = self.get_value(0, size)
32 return coff.decode_asciiz(value) # not COFF-specific
33
34 def get_value(self, offset, size):
35 section = self._symbol["st_shndx"]
36 data = self._image.get_section(section).data()
37 base = self._symbol["st_value"] + offset
38 return data[base : base + size]
39
40
41class ELFImage:

Callers 2

find_by_nameMethod · 0.85
find_by_patternMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected