From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3B5744552E for ; Mon, 1 Jul 2024 12:56:34 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 30014427AC; Mon, 1 Jul 2024 12:56:34 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) by mails.dpdk.org (Postfix) with ESMTP id DC3DA42686; Mon, 1 Jul 2024 12:56:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1719831392; x=1751367392; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=FeIOCq+gIzbyq0/HY/7S07+dawkQrP9TH0GXo+8RtG0=; b=hiiJEVVZUV5TLOcAzVLjAEHysqL+in6c5kSJloUoy6zZQyoaDI8y0oRU qU+wZzuxUU/jlYFsmbt/D9UW7rGzAwcQJan16Kj5h3kmUO6na1xSPixV8 A0YieRrOqyYu5zzlMUN8uk1MQXYzzjj1mUaw1BtGxCF+5CYXepoGLTuoa V023mYGP5QqpQgR/btyPPuHRKYcgta/tvN5h+58KKO5EzkvCTEEG9vR8t s6Vv2pmYNFLfRN3VeNbOo8/c+0dCbPvPnXrIVzBf4LT6lvHZAe7tVKPK4 Qg/fcsh/pw/EKRterj5VxChYzb+sBigmHT+Br34DF5n0tAZqgYD43phpi A==; X-CSE-ConnectionGUID: t6TsGTmoQW+0Xy2Oq1xWQg== X-CSE-MsgGUID: kAulKmKDQNiZc2zTyqLlTA== X-IronPort-AV: E=McAfee;i="6700,10204,11119"; a="20707418" X-IronPort-AV: E=Sophos;i="6.09,176,1716274800"; d="scan'208";a="20707418" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jul 2024 03:56:29 -0700 X-CSE-ConnectionGUID: E/0Al8B4SYyJR6OH9F+vug== X-CSE-MsgGUID: HWItVsRCQvaQI6twdPk2+Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,176,1716274800"; d="scan'208";a="76198264" Received: from unknown (HELO localhost.localdomain) ([10.239.252.253]) by orviesa002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jul 2024 03:56:27 -0700 From: Mingjin Ye To: dev@dpdk.org Cc: Mingjin Ye , stable@dpdk.org, Dmitry Kozlyuk Subject: [PATCH v2] buildtools: fix invalid symbols Date: Mon, 1 Jul 2024 10:33:15 +0000 Message-Id: <20240701103315.835249-1-mingjinx.ye@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240627101144.665413-1-mingjinx.ye@intel.com> References: <20240627101144.665413-1-mingjinx.ye@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org 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: stable@dpdk.org Signed-off-by: Mingjin Ye --- 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