+2012-07-18 Cary Coutant <ccoutant@google.com>
+
+ PR gold/14344
+ * configure.ac: Add check for -gpubnames support.
+ * configure: Regenerate.
+ * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
+ support; force -gno-pubnames.
+ (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
+ support.
+ (gdb_index_test_4): New test.
+ * testsuite/Makefile.in: Regenerate.
+ * testsuite/gdb_index_test_1.sh: Refactor code into common file.
+ * testsuite/gdb_index_test_2.sh: Likewise.
+ * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
+ * testsuite/gdb_index_test_4.sh: New script.
+ * testsuite/gdb_index_test_comm.sh: New script with common code;
+ don't look for space after colon.
+
2012-07-16 Sriraman Tallam <tmsriram@google.com>
* gold.cc (queue_middle_tasks): Update function order only after
MAINT
MAINTAINER_MODE_FALSE
MAINTAINER_MODE_TRUE
+HAVE_PUBNAMES_FALSE
+HAVE_PUBNAMES_TRUE
CXXCPP
HAVE_ZLIB_FALSE
HAVE_ZLIB_TRUE
fi
+save_CXXFLAGS="$CXXFLAGS"
+CXXFLAGS="$CXXFLAGS -gpubnames"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ have_pubnames=yes
+else
+ have_pubnames=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+CXXFLAGS="$save_CXXFLAGS"
+ if test "$have_pubnames" = "yes"; then
+ HAVE_PUBNAMES_TRUE=
+ HAVE_PUBNAMES_FALSE='#'
+else
+ HAVE_PUBNAMES_TRUE='#'
+ HAVE_PUBNAMES_FALSE=
+fi
+
+
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
as_fn_error "conditional \"HAVE_ZLIB\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${HAVE_PUBNAMES_TRUE}" && test -z "${HAVE_PUBNAMES_FALSE}"; then
+ as_fn_error "conditional \"HAVE_PUBNAMES\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
as_fn_error "conditional \"MAINTAINER_MODE\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
[Define if struct stat has a field st_mtim with timespec for mtime])
fi
+dnl Check if gcc supports the -gpubnames option.
+save_CXXFLAGS="$CXXFLAGS"
+CXXFLAGS="$CXXFLAGS -gpubnames"
+AC_COMPILE_IFELSE([int i;], [have_pubnames=yes], [have_pubnames=no])
+CXXFLAGS="$save_CXXFLAGS"
+AM_CONDITIONAL(HAVE_PUBNAMES, test "$have_pubnames" = "yes")
+
AC_LANG_POP(C++)
AC_CHECK_HEADERS(locale.h)
memory_test.stdout: memory_test
$(TEST_READELF) -lWS $< > $@
-# Test that --gdb-index functions correctly.
+if HAVE_PUBNAMES
+
+# Test that --gdb-index functions correctly without gcc-generated pubnames.
check_SCRIPTS += gdb_index_test_1.sh
check_DATA += gdb_index_test_1.stdout
MOSTLYCLEANFILES += gdb_index_test_1.stdout gdb_index_test_1
gdb_index_test.o: gdb_index_test.cc
- $(CXXCOMPILE) -O0 -g -c -o $@ $<
+ $(CXXCOMPILE) -O0 -g -gno-pubnames -c -o $@ $<
gdb_index_test_1: gdb_index_test.o gcctestdir/ld
$(CXXLINK) -Bgcctestdir/ -Wl,--gdb-index $<
gdb_index_test_1.stdout: gdb_index_test_1
if HAVE_ZLIB
+# Test that --gdb-index functions correctly with compressed debug sections.
check_SCRIPTS += gdb_index_test_2.sh
check_DATA += gdb_index_test_2.stdout
MOSTLYCLEANFILES += gdb_index_test_2.stdout gdb_index_test_2
endif HAVE_ZLIB
-# Another simple C test (DW_AT_high_pc encoding) for --gdb-index
+# Another simple C test (DW_AT_high_pc encoding) for --gdb-index.
check_SCRIPTS += gdb_index_test_3.sh
check_DATA += gdb_index_test_3.stdout
MOSTLYCLEANFILES += gdb_index_test_3.stdout gdb_index_test_3
gdb_index_test_3.stdout: gdb_index_test_3
$(TEST_READELF) --debug-dump=gdb_index $< > $@
+# Test that --gdb-index functions correctly with gcc-generated pubnames.
+check_SCRIPTS += gdb_index_test_4.sh
+check_DATA += gdb_index_test_4.stdout
+MOSTLYCLEANFILES += gdb_index_test_4.stdout gdb_index_test_4
+gdb_index_test_pub.o: gdb_index_test.cc
+ $(CXXCOMPILE) -O0 -g -gpubnames -c -o $@ $<
+gdb_index_test_4: gdb_index_test_pub.o gcctestdir/ld
+ $(CXXLINK) -Bgcctestdir/ -Wl,--gdb-index $<
+gdb_index_test_4.stdout: gdb_index_test_4
+ $(TEST_READELF) --debug-dump=gdb_index $< > $@
+
+endif HAVE_PUBNAMES
# End-to-end incremental linking tests.
# Incremental linking is currently supported only on the x86_64 target.
# weak reference in a DSO.
# Test that MEMORY region support works.
-
-# Test that --gdb-index functions correctly.
@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_38 = exclude_libs_test.sh \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ discard_locals_test.sh \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ hidden_test.sh \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ retain_symbols_file_test.sh \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ no_version_test.sh \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ strong_ref_weak_def.sh \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ dyn_weak_ref.sh memory_test.sh \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ gdb_index_test_1.sh
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ dyn_weak_ref.sh memory_test.sh
@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_39 = exclude_libs_test.syms \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ discard_locals_test.syms \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ discard_locals_relocatable_test1.syms \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ no_version_test.stdout \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ strong_ref_weak_def.stdout \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ dyn_weak_ref.stdout \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ memory_test.stdout \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ gdb_index_test_1.stdout
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ memory_test.stdout
@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_40 = exclude_libs_test.syms \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ libexclude_libs_test_1.a \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ libexclude_libs_test_2.a \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ dyn_weak_ref_2.so \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ dyn_weak_ref.stdout \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ memory_test.stdout memory_test \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ memory_test.o \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ gdb_index_test_1.stdout \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ gdb_index_test_1
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ memory_test.o
@GCC_TRUE@@MCMODEL_MEDIUM_TRUE@@NATIVE_LINKER_TRUE@am__append_41 = large
@GCC_FALSE@large_DEPENDENCIES =
@MCMODEL_MEDIUM_FALSE@large_DEPENDENCIES =
# Test that --start-lib and --end-lib function correctly.
@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_53 = start_lib_test
-@GCC_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_LINKER_TRUE@am__append_54 = gdb_index_test_2.sh
-@GCC_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_LINKER_TRUE@am__append_55 = gdb_index_test_2.stdout
-@GCC_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_LINKER_TRUE@am__append_56 = gdb_index_test_2.stdout gdb_index_test_2
-# Another simple C test (DW_AT_high_pc encoding) for --gdb-index
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_57 = gdb_index_test_3.sh
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_58 = gdb_index_test_3.stdout
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_59 = gdb_index_test_3.stdout gdb_index_test_3
+# Test that --gdb-index functions correctly without gcc-generated pubnames.
+@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@am__append_54 = gdb_index_test_1.sh
+@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@am__append_55 = gdb_index_test_1.stdout
+@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@am__append_56 = gdb_index_test_1.stdout gdb_index_test_1
+
+# Test that --gdb-index functions correctly with compressed debug sections.
+@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_LINKER_TRUE@am__append_57 = gdb_index_test_2.sh
+@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_LINKER_TRUE@am__append_58 = gdb_index_test_2.stdout
+@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_LINKER_TRUE@am__append_59 = gdb_index_test_2.stdout gdb_index_test_2
+
+# Another simple C test (DW_AT_high_pc encoding) for --gdb-index.
+
+# Test that --gdb-index functions correctly with gcc-generated pubnames.
+@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@am__append_60 = gdb_index_test_3.sh \
+@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@ gdb_index_test_4.sh
+@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@am__append_61 = gdb_index_test_3.stdout \
+@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@ gdb_index_test_4.stdout
+@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@am__append_62 = gdb_index_test_3.stdout \
+@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@ gdb_index_test_3 \
+@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@ gdb_index_test_4.stdout \
+@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@ gdb_index_test_4
# Test the --incremental-unchanged flag with an archive library.
# The second link should not update the library.
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_60 = incremental_test_2 \
+@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_63 = incremental_test_2 \
@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_test_3 \
@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_test_4 \
@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_test_5 \
@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_copy_test \
@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_common_test_1 \
@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_comdat_test_1
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_61 = two_file_test_tmp_2.o \
+@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_64 = two_file_test_tmp_2.o \
@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_test_tmp_3.o \
@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_test_4.base \
@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_test_tmp_4.o \
# These tests work with native and cross linkers.
# Test script section order.
-@NATIVE_OR_CROSS_LINKER_TRUE@am__append_62 = script_test_10.sh
-@NATIVE_OR_CROSS_LINKER_TRUE@am__append_63 = script_test_10.stdout
+@NATIVE_OR_CROSS_LINKER_TRUE@am__append_65 = script_test_10.sh
+@NATIVE_OR_CROSS_LINKER_TRUE@am__append_66 = script_test_10.stdout
# These tests work with cross linkers only.
-@DEFAULT_TARGET_I386_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_64 = split_i386.sh
-@DEFAULT_TARGET_I386_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_65 = split_i386_1.stdout split_i386_2.stdout \
+@DEFAULT_TARGET_I386_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_67 = split_i386.sh
+@DEFAULT_TARGET_I386_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_68 = split_i386_1.stdout split_i386_2.stdout \
@DEFAULT_TARGET_I386_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_i386_3.stdout split_i386_4.stdout split_i386_r.stdout
-@DEFAULT_TARGET_I386_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_66 = split_i386_1 split_i386_2 split_i386_3 \
+@DEFAULT_TARGET_I386_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_69 = split_i386_1 split_i386_2 split_i386_3 \
@DEFAULT_TARGET_I386_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_i386_4 split_i386_r
-@DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_67 = split_x86_64.sh
-@DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_68 = split_x86_64_1.stdout split_x86_64_2.stdout \
+@DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_70 = split_x86_64.sh
+@DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_71 = split_x86_64_1.stdout split_x86_64_2.stdout \
@DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_x86_64_3.stdout split_x86_64_4.stdout split_x86_64_r.stdout
-@DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_69 = split_x86_64_1 split_x86_64_2 split_x86_64_3 \
+@DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_72 = split_x86_64_1 split_x86_64_2 split_x86_64_3 \
@DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_x86_64_4 split_x86_64_r
# Check Thumb to Thumb farcall veneers
# Check Thumb to ARM farcall veneers
-@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_70 = arm_abs_global.sh \
+@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_73 = arm_abs_global.sh \
@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_branch_in_range.sh \
@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_branch_out_of_range.sh \
@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_fix_v4bx.sh \
@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_farcall_arm_thumb.sh \
@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_farcall_thumb_thumb.sh \
@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_farcall_thumb_arm.sh
-@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_71 = arm_abs_global.stdout \
+@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_74 = arm_abs_global.stdout \
@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_bl_in_range.stdout \
@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_bl_out_of_range.stdout \
@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ thumb_bl_in_range.stdout \
@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_farcall_thumb_thumb_6m.stdout \
@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_farcall_thumb_arm.stdout \
@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_farcall_thumb_arm_5t.stdout
-@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_72 = arm_abs_global \
+@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_75 = arm_abs_global \
@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_bl_in_range \
@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_bl_out_of_range \
@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ thumb_bl_in_range \
MOSTLYCLEANFILES = *.so *.syms *.stdout $(am__append_4) \
$(am__append_17) $(am__append_26) $(am__append_28) \
$(am__append_30) $(am__append_36) $(am__append_40) \
- $(am__append_56) $(am__append_59) $(am__append_61) \
- $(am__append_66) $(am__append_69) $(am__append_72)
+ $(am__append_56) $(am__append_59) $(am__append_62) \
+ $(am__append_64) $(am__append_69) $(am__append_72) \
+ $(am__append_75)
# We will add to these later, for each individual test. Note
# that we add each test under check_SCRIPTS or check_PROGRAMS;
# the TESTS variable is automatically populated from these.
check_SCRIPTS = $(am__append_2) $(am__append_34) $(am__append_38) \
- $(am__append_54) $(am__append_57) $(am__append_62) \
- $(am__append_64) $(am__append_67) $(am__append_70)
+ $(am__append_54) $(am__append_57) $(am__append_60) \
+ $(am__append_65) $(am__append_67) $(am__append_70) \
+ $(am__append_73)
check_DATA = $(am__append_3) $(am__append_27) $(am__append_29) \
$(am__append_35) $(am__append_39) $(am__append_55) \
- $(am__append_58) $(am__append_63) $(am__append_65) \
- $(am__append_68) $(am__append_71)
+ $(am__append_58) $(am__append_61) $(am__append_66) \
+ $(am__append_68) $(am__append_71) $(am__append_74)
BUILT_SOURCES = $(am__append_25)
TESTS = $(check_SCRIPTS) $(check_PROGRAMS)
@p='gdb_index_test_2.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
gdb_index_test_3.sh.log: gdb_index_test_3.sh
@p='gdb_index_test_3.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+gdb_index_test_4.sh.log: gdb_index_test_4.sh
+ @p='gdb_index_test_4.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
script_test_10.sh.log: script_test_10.sh
@p='script_test_10.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
split_i386.sh.log: split_i386.sh
@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(LINK) -Bgcctestdir/ -nostartfiles -nostdlib -T $(srcdir)/memory_test.t -o $@ memory_test.o
@GCC_TRUE@@NATIVE_LINKER_TRUE@memory_test.stdout: memory_test
@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(TEST_READELF) -lWS $< > $@
-@GCC_TRUE@@NATIVE_LINKER_TRUE@gdb_index_test.o: gdb_index_test.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -O0 -g -c -o $@ $<
-@GCC_TRUE@@NATIVE_LINKER_TRUE@gdb_index_test_1: gdb_index_test.o gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ -Wl,--gdb-index $<
-@GCC_TRUE@@NATIVE_LINKER_TRUE@gdb_index_test_1.stdout: gdb_index_test_1
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(TEST_READELF) --debug-dump=gdb_index $< > $@
-@GCC_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_LINKER_TRUE@gdb_index_test_cdebug.o: gdb_index_test.cc
-@GCC_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -Wa,--compress-debug-sections -c -o $@ $<
-@GCC_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_LINKER_TRUE@gdb_index_test_2: gdb_index_test_cdebug.o gcctestdir/ld
-@GCC_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ -Wl,--gdb-index $<
-@GCC_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_LINKER_TRUE@gdb_index_test_2.stdout: gdb_index_test_2
-@GCC_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_LINKER_TRUE@ $(TEST_READELF) --debug-dump=gdb_index $< > $@
-@GCC_TRUE@@NATIVE_LINKER_TRUE@gdb_index_test_3.o: gdb_index_test_3.c
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -O0 -g -c -o $@ $<
-@GCC_TRUE@@NATIVE_LINKER_TRUE@gdb_index_test_3: gdb_index_test_3.o gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(LINK) -Bgcctestdir/ -Wl,--gdb-index,--fatal-warnings $<
-@GCC_TRUE@@NATIVE_LINKER_TRUE@gdb_index_test_3.stdout: gdb_index_test_3
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(TEST_READELF) --debug-dump=gdb_index $< > $@
+@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@gdb_index_test.o: gdb_index_test.cc
+@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -O0 -g -gno-pubnames -c -o $@ $<
+@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@gdb_index_test_1: gdb_index_test.o gcctestdir/ld
+@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ -Wl,--gdb-index $<
+@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@gdb_index_test_1.stdout: gdb_index_test_1
+@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@ $(TEST_READELF) --debug-dump=gdb_index $< > $@
+@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_LINKER_TRUE@gdb_index_test_cdebug.o: gdb_index_test.cc
+@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -Wa,--compress-debug-sections -c -o $@ $<
+@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_LINKER_TRUE@gdb_index_test_2: gdb_index_test_cdebug.o gcctestdir/ld
+@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ -Wl,--gdb-index $<
+@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_LINKER_TRUE@gdb_index_test_2.stdout: gdb_index_test_2
+@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_LINKER_TRUE@ $(TEST_READELF) --debug-dump=gdb_index $< > $@
+@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@gdb_index_test_3.o: gdb_index_test_3.c
+@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -O0 -g -c -o $@ $<
+@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@gdb_index_test_3: gdb_index_test_3.o gcctestdir/ld
+@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@ $(LINK) -Bgcctestdir/ -Wl,--gdb-index,--fatal-warnings $<
+@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@gdb_index_test_3.stdout: gdb_index_test_3
+@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@ $(TEST_READELF) --debug-dump=gdb_index $< > $@
+@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@gdb_index_test_pub.o: gdb_index_test.cc
+@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -O0 -g -gpubnames -c -o $@ $<
+@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@gdb_index_test_4: gdb_index_test_pub.o gcctestdir/ld
+@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ -Wl,--gdb-index $<
+@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@gdb_index_test_4.stdout: gdb_index_test_4
+@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@ $(TEST_READELF) --debug-dump=gdb_index $< > $@
# End-to-end incremental linking tests.
# Incremental linking is currently supported only on the x86_64 target.
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
# MA 02110-1301, USA.
-check()
-{
- if ! grep -q "$2" "$1"
- then
- echo "Did not find expected output:"
- echo " $2"
- echo ""
- echo "Actual error output below:"
- cat "$1"
- exit 1
- fi
-}
-
-STDOUT=gdb_index_test_1.stdout
-
-check $STDOUT "^Version [45]"
-
-# Look for the symbols we know should be in the symbol table.
-
-check $STDOUT "^\[ *[0-9]*\] (anonymous namespace): "
-check $STDOUT "^\[ *[0-9]*\] (anonymous namespace)::c1_count: "
-check $STDOUT "^\[ *[0-9]*\] (anonymous namespace)::c2_count: "
-check $STDOUT "^\[ *[0-9]*\] bool: "
-check $STDOUT "^\[ *[0-9]*\] check<one::c1>: "
-check $STDOUT "^\[ *[0-9]*\] check<two::c2<double> >: "
-check $STDOUT "^\[ *[0-9]*\] check<two::c2<int> >: "
-# check $STDOUT "^\[ *[0-9]*\] check<two::c2<int const\*> >: "
-check $STDOUT "^\[ *[0-9]*\] double: "
-check $STDOUT "^\[ *[0-9]*\] F_A: "
-check $STDOUT "^\[ *[0-9]*\] F_B: "
-check $STDOUT "^\[ *[0-9]*\] F_C: "
-check $STDOUT "^\[ *[0-9]*\] int: "
-check $STDOUT "^\[ *[0-9]*\] main: "
-check $STDOUT "^\[ *[0-9]*\] one: "
-check $STDOUT "^\[ *[0-9]*\] one::c1: "
-check $STDOUT "^\[ *[0-9]*\] one::c1::~c1: "
-check $STDOUT "^\[ *[0-9]*\] one::c1::c1: "
-check $STDOUT "^\[ *[0-9]*\] one::c1::val: "
-check $STDOUT "^\[ *[0-9]*\] one::c1v: "
-check $STDOUT "^\[ *[0-9]*\] one::G_A: "
-check $STDOUT "^\[ *[0-9]*\] one::G_B: "
-check $STDOUT "^\[ *[0-9]*\] one::G_B: "
-check $STDOUT "^\[ *[0-9]*\] two: "
-check $STDOUT "^\[ *[0-9]*\] two::c2<double>::~c2: "
-check $STDOUT "^\[ *[0-9]*\] two::c2<double>::c2: "
-check $STDOUT "^\[ *[0-9]*\] two::c2<double>::val: "
-check $STDOUT "^\[ *[0-9]*\] two::c2<double>: "
-check $STDOUT "^\[ *[0-9]*\] two::c2<int const\*>: "
-check $STDOUT "^\[ *[0-9]*\] two::c2<int const\*>::~c2: "
-check $STDOUT "^\[ *[0-9]*\] two::c2<int const\*>::c2: "
-check $STDOUT "^\[ *[0-9]*\] two::c2<int const\*>::val: "
-check $STDOUT "^\[ *[0-9]*\] two::c2<int>::~c2: "
-check $STDOUT "^\[ *[0-9]*\] two::c2<int>::c2: "
-check $STDOUT "^\[ *[0-9]*\] two::c2<int>::val: "
-check $STDOUT "^\[ *[0-9]*\] two::c2<int>: "
-check $STDOUT "^\[ *[0-9]*\] two::c2v1: "
-check $STDOUT "^\[ *[0-9]*\] two::c2v2: "
-check $STDOUT "^\[ *[0-9]*\] anonymous_union_var: "
-
-exit 0
+exec ${srcdir}/gdb_index_test_comm.sh gdb_index_test_1.stdout
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
# MA 02110-1301, USA.
-check()
-{
- if ! grep -q "$2" "$1"
- then
- echo "Did not find expected output:"
- echo " $2"
- echo ""
- echo "Actual error output below:"
- cat "$1"
- exit 1
- fi
-}
-
-STDOUT=gdb_index_test_2.stdout
-
-check $STDOUT "^Version [45]"
-
-# Look for the symbols we know should be in the symbol table.
-
-check $STDOUT "^\[ *[0-9]*\] (anonymous namespace): "
-check $STDOUT "^\[ *[0-9]*\] (anonymous namespace)::c1_count: "
-check $STDOUT "^\[ *[0-9]*\] (anonymous namespace)::c2_count: "
-check $STDOUT "^\[ *[0-9]*\] bool: "
-check $STDOUT "^\[ *[0-9]*\] check<one::c1>: "
-check $STDOUT "^\[ *[0-9]*\] check<two::c2<double> >: "
-check $STDOUT "^\[ *[0-9]*\] check<two::c2<int> >: "
-# check $STDOUT "^\[ *[0-9]*\] check<two::c2<int const\*> >: "
-check $STDOUT "^\[ *[0-9]*\] double: "
-check $STDOUT "^\[ *[0-9]*\] F_A: "
-check $STDOUT "^\[ *[0-9]*\] F_B: "
-check $STDOUT "^\[ *[0-9]*\] F_C: "
-check $STDOUT "^\[ *[0-9]*\] int: "
-check $STDOUT "^\[ *[0-9]*\] main: "
-check $STDOUT "^\[ *[0-9]*\] one: "
-check $STDOUT "^\[ *[0-9]*\] one::c1: "
-check $STDOUT "^\[ *[0-9]*\] one::c1::~c1: "
-check $STDOUT "^\[ *[0-9]*\] one::c1::c1: "
-check $STDOUT "^\[ *[0-9]*\] one::c1::val: "
-check $STDOUT "^\[ *[0-9]*\] one::c1v: "
-check $STDOUT "^\[ *[0-9]*\] one::G_A: "
-check $STDOUT "^\[ *[0-9]*\] one::G_B: "
-check $STDOUT "^\[ *[0-9]*\] one::G_B: "
-check $STDOUT "^\[ *[0-9]*\] two: "
-check $STDOUT "^\[ *[0-9]*\] two::c2<double>::~c2: "
-check $STDOUT "^\[ *[0-9]*\] two::c2<double>::c2: "
-check $STDOUT "^\[ *[0-9]*\] two::c2<double>::val: "
-check $STDOUT "^\[ *[0-9]*\] two::c2<double>: "
-check $STDOUT "^\[ *[0-9]*\] two::c2<int const\*>: "
-check $STDOUT "^\[ *[0-9]*\] two::c2<int const\*>::~c2: "
-check $STDOUT "^\[ *[0-9]*\] two::c2<int const\*>::c2: "
-check $STDOUT "^\[ *[0-9]*\] two::c2<int const\*>::val: "
-check $STDOUT "^\[ *[0-9]*\] two::c2<int>::~c2: "
-check $STDOUT "^\[ *[0-9]*\] two::c2<int>::c2: "
-check $STDOUT "^\[ *[0-9]*\] two::c2<int>::val: "
-check $STDOUT "^\[ *[0-9]*\] two::c2<int>: "
-check $STDOUT "^\[ *[0-9]*\] two::c2v1: "
-check $STDOUT "^\[ *[0-9]*\] two::c2v2: "
-check $STDOUT "^\[ *[0-9]*\] anonymous_union_var: "
-
-exit 0
+exec ${srcdir}/gdb_index_test_comm.sh gdb_index_test_2.stdout
# Look for the symbols we know should be in the symbol table.
-check $STDOUT "^\[ *[0-9]*\] main: "
-check $STDOUT "^\[ *[0-9]*\] check_int: "
-check $STDOUT "^\[ *[0-9]*\] j: "
-check $STDOUT "^\[ *[0-9]*\] int: "
+check $STDOUT "^\[ *[0-9]*\] main:"
+check $STDOUT "^\[ *[0-9]*\] check_int:"
+check $STDOUT "^\[ *[0-9]*\] j:"
+check $STDOUT "^\[ *[0-9]*\] int:"
exit 0
--- /dev/null
+#!/bin/sh
+
+# gdb_index_test_4.sh -- a test case for the --gdb-index option.
+
+# Copyright 2012 Free Software Foundation, Inc.
+# Written by Cary Coutant <ccoutant@google.com>.
+
+# This file is part of gold.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+exec ${srcdir}/gdb_index_test_comm.sh gdb_index_test_4.stdout
--- /dev/null
+#!/bin/sh
+
+# gdb_index_test_comm.sh -- common code for --gdb-index tests.
+
+# Copyright 2012 Free Software Foundation, Inc.
+# Written by Cary Coutant <ccoutant@google.com>.
+
+# This file is part of gold.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+check()
+{
+ if ! grep -q "$2" "$1"
+ then
+ echo "Did not find expected output:"
+ echo " $2"
+ echo ""
+ echo "Actual error output below:"
+ cat "$1"
+ exit 1
+ fi
+}
+
+STDOUT="$1"
+
+check $STDOUT "^Version [45]"
+
+# Look for the symbols we know should be in the symbol table.
+
+check $STDOUT "^\[ *[0-9]*\] (anonymous namespace):"
+check $STDOUT "^\[ *[0-9]*\] (anonymous namespace)::c1_count:"
+check $STDOUT "^\[ *[0-9]*\] (anonymous namespace)::c2_count:"
+check $STDOUT "^\[ *[0-9]*\] bool:"
+check $STDOUT "^\[ *[0-9]*\] check<one::c1>:"
+check $STDOUT "^\[ *[0-9]*\] check<two::c2<double> >:"
+check $STDOUT "^\[ *[0-9]*\] check<two::c2<int> >:"
+# check $STDOUT "^\[ *[0-9]*\] check<two::c2<int const\*> >:"
+check $STDOUT "^\[ *[0-9]*\] double:"
+check $STDOUT "^\[ *[0-9]*\] F_A:"
+check $STDOUT "^\[ *[0-9]*\] F_B:"
+check $STDOUT "^\[ *[0-9]*\] F_C:"
+check $STDOUT "^\[ *[0-9]*\] int:"
+check $STDOUT "^\[ *[0-9]*\] main:"
+check $STDOUT "^\[ *[0-9]*\] one:"
+check $STDOUT "^\[ *[0-9]*\] one::c1:"
+check $STDOUT "^\[ *[0-9]*\] one::c1::~c1:"
+check $STDOUT "^\[ *[0-9]*\] one::c1::c1:"
+check $STDOUT "^\[ *[0-9]*\] one::c1::val:"
+check $STDOUT "^\[ *[0-9]*\] one::c1v:"
+check $STDOUT "^\[ *[0-9]*\] one::G_A:"
+check $STDOUT "^\[ *[0-9]*\] one::G_B:"
+check $STDOUT "^\[ *[0-9]*\] one::G_B:"
+check $STDOUT "^\[ *[0-9]*\] two:"
+check $STDOUT "^\[ *[0-9]*\] two::c2<double>::~c2:"
+check $STDOUT "^\[ *[0-9]*\] two::c2<double>::c2:"
+check $STDOUT "^\[ *[0-9]*\] two::c2<double>::val:"
+check $STDOUT "^\[ *[0-9]*\] two::c2<double>:"
+check $STDOUT "^\[ *[0-9]*\] two::c2<int const\*>:"
+check $STDOUT "^\[ *[0-9]*\] two::c2<int const\*>::~c2:"
+check $STDOUT "^\[ *[0-9]*\] two::c2<int const\*>::c2:"
+check $STDOUT "^\[ *[0-9]*\] two::c2<int const\*>::val:"
+check $STDOUT "^\[ *[0-9]*\] two::c2<int>::~c2:"
+check $STDOUT "^\[ *[0-9]*\] two::c2<int>::c2:"
+check $STDOUT "^\[ *[0-9]*\] two::c2<int>::val:"
+check $STDOUT "^\[ *[0-9]*\] two::c2<int>:"
+check $STDOUT "^\[ *[0-9]*\] two::c2v1:"
+check $STDOUT "^\[ *[0-9]*\] two::c2v2:"
+check $STDOUT "^\[ *[0-9]*\] anonymous_union_var:"
+
+exit 0