From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <nhorman@tuxdriver.com>
Received: from smtp.tuxdriver.com (charlotte.tuxdriver.com [70.61.120.58])
 by dpdk.org (Postfix) with ESMTP id 6DE3F1B69B
 for <dev@dpdk.org>; Wed, 10 Oct 2018 16:30:22 +0200 (CEST)
Received: from cpe-2606-a000-111b-40fe-f1c6-eb46-ccca-fca5.dyn6.twc.com
 ([2606:a000:111b:40fe:f1c6:eb46:ccca:fca5] helo=hmswarspite.think-freely.org)
 by smtp.tuxdriver.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.63)
 (envelope-from <nhorman@tuxdriver.com>)
 id 1gAFV1-0006g8-Ni; Wed, 10 Oct 2018 10:30:17 -0400
Received: from hmswarspite.think-freely.org (localhost [127.0.0.1])
 by hmswarspite.think-freely.org (8.15.2/8.15.2) with ESMTP id w9AETYib011320; 
 Wed, 10 Oct 2018 10:29:34 -0400
Received: (from nhorman@localhost)
 by hmswarspite.think-freely.org (8.15.2/8.15.2/Submit) id w9AETXNB011319;
 Wed, 10 Oct 2018 10:29:33 -0400
From: Neil Horman <nhorman@tuxdriver.com>
To: dev@dpdk.org
Cc: Neil Horman <nhorman@tuxdriver.com>, Thomas Monjalon <thomas@monjalon.net>,
 Ferruh Yigit <ferruh.yigit@intel.com>
Date: Wed, 10 Oct 2018 10:29:28 -0400
Message-Id: <20181010142928.11274-1-nhorman@tuxdriver.com>
X-Mailer: git-send-email 2.17.1
X-Spam-Score: -2.9 (--)
X-Spam-Status: No
Subject: [dpdk-dev] [PATCH] check-experimental-syms.sh: prevent symbol
	matches on substrings
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Wed, 10 Oct 2018 14:30:22 -0000

Thomas attempted to submit this:
https://patches.dpdk.org/patch/46311/

The other day, because the other patches being submitted with it were
breaking on a false positive from the check-experimental-syms check.

The problem was that the experimental symbol check script matched on the
regexs "\.text.*$SYM" and "\.text\.experimental.*$SYM" which allows for
substring matches, and librte_ethdev recently introduced symbols that
are leading substrings of one another (e.g. symbol foo is a substring of
symbol foobar), and so we would match on symbols when we shouldn't

Instead of dropping the check, fix this properly by matching
additionally on the end of line so that symbols are an exact match.

Confirmed to build properly on Thomas' submitted patch set with the
experimental check patch reverted (so that the checking actually
happens)

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: Thomas Monjalon <thomas@monjalon.net>
CC: Ferruh Yigit <ferruh.yigit@intel.com>
---
 buildtools/check-experimental-syms.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/buildtools/check-experimental-syms.sh b/buildtools/check-experimental-syms.sh
index 5bc8cda17..d0915102d 100755
--- a/buildtools/check-experimental-syms.sh
+++ b/buildtools/check-experimental-syms.sh
@@ -16,9 +16,9 @@ for i in `awk 'BEGIN {found=0}
 		/.*;/ {if (found == 1) print $1}' $MAPFILE`
 do
 	SYM=`echo $i | sed -e"s/;//"`
-	objdump -t $OBJFILE | grep -q "\.text.*$SYM"
+	objdump -t $OBJFILE | grep -q "\.text.*$SYM$"
 	IN_TEXT=$?
-	objdump -t $OBJFILE | grep -q "\.text\.experimental.*$SYM"
+	objdump -t $OBJFILE | grep -q "\.text\.experimental.*$SYM$"
 	IN_EXP=$?
 	if [ $IN_TEXT -eq 0 -a $IN_EXP -ne 0 ]
 	then
-- 
2.17.1