[PATCH 5/5] T360-symbol-hiding: Use nm instead of objdump.

Subject: [PATCH 5/5] T360-symbol-hiding: Use nm instead of objdump.

Date: Tue, 6 May 2014 13:02:28 -0400

To: notmuch@notmuchmail.org

Cc:

From: Charles Celerier


The output of `objdump -t` depends on the format of the object files
which are different across platforms (e.g. Mac OS X). Since we really
just want to filter the symbols in the object file, nm is a more
appropriate tool since it only lists symbols from object files (nm(1))
and has a consistent output format.

Signed-off-by: Charles Celerier <cceleri@cs.stanford.edu>
---
 test/T360-symbol-hiding.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/test/T360-symbol-hiding.sh b/test/T360-symbol-hiding.sh
index 97c734a..c5bbf27 100755
--- a/test/T360-symbol-hiding.sh
+++ b/test/T360-symbol-hiding.sh
@@ -33,7 +33,8 @@ test_begin_subtest 'checking output'
 test_expect_equal "$result" "$output"
 
 test_begin_subtest 'comparing existing to exported symbols'
-objdump -t $TEST_DIRECTORY/../lib/*.o | awk '$4 == ".text" && $6 ~ "^notmuch" {print $6}' | sort | uniq > ACTUAL
+
+nm -g $TEST_DIRECTORY/../lib/*.o | sed -n 's/.*\s\+T\s\+_\(notmuch_.*\)/\1/p' | sort | uniq > ACTUAL
 sed -n 's/[[:blank:]]*\(notmuch_[^;]*\);/\1/p' $TEST_DIRECTORY/../notmuch.sym | sort | uniq > EXPORTED
 test_expect_equal_file EXPORTED ACTUAL
 
-- 
1.8.5.2 (Apple Git-48)


Thread: