Elf files generated by higher version compilers wrap multiple symbols prefixed with "this_pmd_name".
The patch uses the regex "^this_pmd_name[0-9]+$" to match the symbol name. Bugzilla ID: 1466 Fixes: 6c4bf8f42432 ("buildtools: add Python pmdinfogen") Cc: sta...@dpdk.org Signed-off-by: Mingjin Ye <mingjinx...@intel.com> --- v2: Use regex ^this_pmd_name[0-9]+$ to filter symbols *names* --- buildtools/pmdinfogen.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/buildtools/pmdinfogen.py b/buildtools/pmdinfogen.py index 2a44f17bda..0fbcc697ed 100755 --- a/buildtools/pmdinfogen.py +++ b/buildtools/pmdinfogen.py @@ -6,6 +6,7 @@ import argparse import ctypes import json +import re import sys import tempfile @@ -70,7 +71,7 @@ def find_by_prefix(self, prefix): prefix = prefix.encode("utf-8") if self._legacy_elftools else prefix for i in range(self._symtab.num_symbols()): symbol = self._symtab.get_symbol(i) - if symbol.name.startswith(prefix): + if re.match(prefix, symbol.name): yield ELFSymbol(self._image, symbol) @@ -199,7 +200,7 @@ def dump(self, file): def load_drivers(image): drivers = [] - for symbol in image.find_by_prefix("this_pmd_name"): + for symbol in image.find_by_prefix("^this_pmd_name[0-9]+$"): drivers.append(Driver.load(image, symbol)) return drivers -- 2.25.1