From 6422a80df992e4542dbd4fb70a04f316065674af Mon Sep 17 00:00:00 2001 From: Rahul Chaudhry Date: Tue, 28 Jun 2016 14:33:51 -0700 Subject: Remove warning about references from shared objects to hidden symbols. Bug: 21502954 This patch is backported from upstream - commit c20ceeb226168ffd84078ef74d890c2b7f69a435 Author: Yiran Wang Date: Mon Jul 20 08:47:57 2015 -0700 Remove warning about references from shared objects to hidden symbols. gold/ PR gold/15574 * resolve.cc (Symbol_table): Remove warning about references from shared objects to hidden symbols. * testsuite/Makefile.am (hidden_test): Add hidden_test.syms. * testsuite/Makefile.in: Regenerate. * testsuite/hidden_test.sh: Check dynamic symbol table; update expected error messages. Change-Id: Ie6fb67071c7f478859069b7b4bf629cd44f91844 --- binutils-2.25/gold/testsuite/hidden_test.sh | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'binutils-2.25/gold/testsuite/hidden_test.sh') diff --git a/binutils-2.25/gold/testsuite/hidden_test.sh b/binutils-2.25/gold/testsuite/hidden_test.sh index 39ebbf68..05633d04 100755 --- a/binutils-2.25/gold/testsuite/hidden_test.sh +++ b/binutils-2.25/gold/testsuite/hidden_test.sh @@ -29,11 +29,11 @@ # error messages are issued for the references to internal and # hidden symbols. The errors will be found in hidden_test.err. -check() +check_missing() { - if ! grep -q "$2" "$1" + if grep -q "$2" "$1" then - echo "Did not find expected error in $1:" + echo "Found unexpected error in $1:" echo " $2" echo "" echo "Actual error output below:" @@ -42,25 +42,29 @@ check() fi } -check_missing() +check_missing_sym() { if grep -q "$2" "$1" then - echo "Found unexpected error in $1:" + echo "Found unexpected symbol in $1:" echo " $2" echo "" - echo "Actual error output below:" + echo "Actual nm output below:" cat "$1" exit 1 fi } -# We should see errors for hidden and internal symbols. -check hidden_test.err "hidden symbol 'main_hidden' in hidden_test_main.o is referenced by DSO libhidden.so" -check hidden_test.err "internal symbol 'main_internal' in hidden_test_main.o is referenced by DSO libhidden.so" - # We shouldn't see errors for the default and protected symbols. check_missing hidden_test.err "main_default" check_missing hidden_test.err "main_protected" +# We shouldn't see errors for the hidden and internal symbols either (PR 15574). +check_missing hidden_test.err "main_hidden" +check_missing hidden_test.err "main_internal" + +# We shouldn't see the hidden or internal symbols in the dynamic symbol table. +check_missing_sym hidden_test.syms "main_hidden" +check_missing_sym hidden_test.syms "main_internal" + exit 0 -- cgit v1.2.3