Skip to content

Commit

Permalink
buildtools: fix invalid symbols
Browse files Browse the repository at this point in the history
In scenarios where a higher clang compiler is used and ASAN is enabled,
the generated ELF file will additionally insert undefined debug symbols
with the same prefix. This causes duplicate C code to be generated.

This patch fixes this issue by skipping the unspecified symbol type.

Fixes: 6c4bf8f ("buildtools: add Python pmdinfogen")
Cc: stable@dpdk.org

Signed-off-by: Mingjin Ye <mingjinx.ye@intel.com>
Signed-off-by: 0-day Robot <robot@bytheb.org>
  • Loading branch information
yemj-odc authored and ovsrobot committed Jul 5, 2024
1 parent a5d4e24 commit 882f324
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions buildtools/pmdinfogen.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ 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)
# Skip unspecified symbol type
if symbol.entry.st_info['type'] == "STT_NOTYPE":
continue
if symbol.name.startswith(prefix):
yield ELFSymbol(self._image, symbol)

Expand Down

0 comments on commit 882f324

Please sign in to comment.