From 5328d922d799b7f24435d3f8142bcc19bab14009 Mon Sep 17 00:00:00 2001 From: Michal Berger Date: Tue, 13 Oct 2020 10:03:57 +0200 Subject: [PATCH] make/check_so_deps: Tell readelf to use wide output Newer versions of readelf (e.g. from binutils v2.35) break the lines in the following manner: .... GLOBAL DEFAULT 14 restore_funcarra[...] The symbol name is shortened, however, the way how it's indicated with "[...]" may mess with any tools that look up this field with a regex pattern - just like grep in the confirm_deps() test. Currently, this test fails on clearlinux where the latest readelf is shipped on board. To avoid it, make sure readelf returns full name of the symbol with the --wide output. Change-Id: Ief1a3dccde5481f603302ee714021dcebc20fc58 Signed-off-by: Michal Berger Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4627 Tested-by: SPDK CI Jenkins Reviewed-by: Shuhei Matsumoto Reviewed-by: Tomasz Zawadzki Reviewed-by: Aleksey Marchuk Reviewed-by: Jim Harris --- test/make/check_so_deps.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/make/check_so_deps.sh b/test/make/check_so_deps.sh index 1e458792a..092a52fde 100755 --- a/test/make/check_so_deps.sh +++ b/test/make/check_so_deps.sh @@ -204,13 +204,13 @@ function confirm_deps() { done done - symbols=$(readelf -s $lib | grep -E "NOTYPE.*GLOBAL.*UND" | awk '{print $8}' | sort | uniq) + symbols=$(readelf -s --wide $lib | grep -E "NOTYPE.*GLOBAL.*UND" | awk '{print $8}' | sort | uniq) for symbol in $symbols; do for deplib in $DEP_LIBS; do if [ "$deplib" == "$lib" ]; then continue fi - found_symbol=$(readelf -s $deplib | grep -E "DEFAULT\s+[0-9]+\s$symbol$") || true + found_symbol=$(readelf -s --wide $deplib | grep -E "DEFAULT\s+[0-9]+\s$symbol$") || true if [ "$found_symbol" != "" ]; then found_symbol_lib=$(basename $deplib | sed 's,libspdk_,,g' | sed 's,\.so,,g') break