diff options
Diffstat (limited to 'gold/testsuite')
-rw-r--r-- | gold/testsuite/Makefile.am | 4 | ||||
-rw-r--r-- | gold/testsuite/Makefile.in | 3 | ||||
-rwxr-xr-x | gold/testsuite/hidden_test.sh | 24 |
3 files changed, 20 insertions, 11 deletions
diff --git a/gold/testsuite/Makefile.am b/gold/testsuite/Makefile.am index 41186c6..cf56c32 100644 --- a/gold/testsuite/Makefile.am +++ b/gold/testsuite/Makefile.am @@ -2099,11 +2099,13 @@ endif MCMODEL_MEDIUM # referenced by a shared library. check_SCRIPTS += hidden_test.sh check_DATA += hidden_test.err -MOSTLYCLEANFILES += hidden_test hidden_test.err +MOSTLYCLEANFILES += hidden_test hidden_test.err hidden_test.syms libhidden.so: hidden_test_1.c gcctestdir/ld $(COMPILE) -Bgcctestdir/ -g -shared -fPIC -w -o $@ $(srcdir)/hidden_test_1.c hidden_test: hidden_test_main.o libhidden.so gcctestdir/ld $(LINK) -Bgcctestdir/ -Wl,-R,. hidden_test_main.o libhidden.so 2>hidden_test.err +hidden_test.syms: hidden_test + $(TEST_NM) -D hidden_test > $@ hidden_test.err: hidden_test @touch hidden_test.err diff --git a/gold/testsuite/Makefile.in b/gold/testsuite/Makefile.in index 563f598..fc10639 100644 --- a/gold/testsuite/Makefile.in +++ b/gold/testsuite/Makefile.in @@ -498,6 +498,7 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ discard_locals_relocatable_test1.out \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ discard_locals_relocatable_test2.out \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ hidden_test hidden_test.err \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@ hidden_test.syms \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ retain_symbols_file_test \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ retain_symbols_file_test.in \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ retain_symbols_file_test.stdout \ @@ -6013,6 +6014,8 @@ uninstall-am: @GCC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -Bgcctestdir/ -g -shared -fPIC -w -o $@ $(srcdir)/hidden_test_1.c @GCC_TRUE@@NATIVE_LINKER_TRUE@hidden_test: hidden_test_main.o libhidden.so gcctestdir/ld @GCC_TRUE@@NATIVE_LINKER_TRUE@ $(LINK) -Bgcctestdir/ -Wl,-R,. hidden_test_main.o libhidden.so 2>hidden_test.err +@GCC_TRUE@@NATIVE_LINKER_TRUE@hidden_test.syms: hidden_test +@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(TEST_NM) -D hidden_test > $@ @GCC_TRUE@@NATIVE_LINKER_TRUE@hidden_test.err: hidden_test @GCC_TRUE@@NATIVE_LINKER_TRUE@ @touch hidden_test.err @GCC_TRUE@@NATIVE_LINKER_TRUE@retain_symbols_file_test.so: basic_pic_test.o gcctestdir/ld diff --git a/gold/testsuite/hidden_test.sh b/gold/testsuite/hidden_test.sh index 8366bc9..48bae4a 100755 --- a/gold/testsuite/hidden_test.sh +++ b/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 |