From dd772ed7552585099b39ecfaafd290d0eea78f80 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Sat, 23 Jun 2007 08:40:54 +0000 Subject: [PATCH] * configure.in (--with-separate-debug-dir): New option. * configure: Regenerate. * Makefile.am (dwarf2.lo): Add rule to pass DEBUGDIR. * Makefile.in: Regenerate. * dwarf2.c (_bfd_dwarf2_find_nearest_line): Pass DEBUGDIR to bfd_follow_gnu_debuglink. (_bfd_dwarf2_find_line): Likewise. --- bfd/ChangeLog | 10 ++++++++++ bfd/Makefile.am | 3 +++ bfd/Makefile.in | 4 ++++ bfd/configure | 44 +++++++++++++++++++++++++++++--------------- bfd/configure.in | 8 ++++++++ bfd/dwarf2.c | 4 ++-- 6 files changed, 56 insertions(+), 17 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index c90897f45..258fd6f40 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,13 @@ +2007-06-23 Andreas Schwab + + * configure.in (--with-separate-debug-dir): New option. + * configure: Regenerate. + * Makefile.am (dwarf2.lo): Add rule to pass DEBUGDIR. + * Makefile.in: Regenerate. + * dwarf2.c (_bfd_dwarf2_find_nearest_line): Pass DEBUGDIR to + bfd_follow_gnu_debuglink. + (_bfd_dwarf2_find_line): Likewise. + 2007-06-22 Nick Clifton * dwarf2.c: Add support for reading in debug information via a diff --git a/bfd/Makefile.am b/bfd/Makefile.am index ed6fc7b1b..28a3cfcd9 100644 --- a/bfd/Makefile.am +++ b/bfd/Makefile.am @@ -784,6 +784,9 @@ targets.lo: targets.c Makefile archures.lo: archures.c Makefile $(LIBTOOL) --mode=compile $(COMPILE) -c $(TDEFAULTS) $(srcdir)/archures.c +dwarf2.lo: dwarf2.c Makefile + $(LIBTOOL) --mode=compile $(COMPILE) -c -DDEBUGDIR=\"$(DEBUGDIR)\" $(srcdir)/dwarf2.c + elf32-target.h : elfxx-target.h rm -f elf32-target.h sed -e s/NN/32/g < $(srcdir)/elfxx-target.h > elf32-target.new diff --git a/bfd/Makefile.in b/bfd/Makefile.in index 48aae80e3..c936a1f88 100644 --- a/bfd/Makefile.in +++ b/bfd/Makefile.in @@ -134,6 +134,7 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ +DEBUGDIR = @DEBUGDIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DUMPBIN = @DUMPBIN@ @@ -1380,6 +1381,9 @@ targets.lo: targets.c Makefile archures.lo: archures.c Makefile $(LIBTOOL) --mode=compile $(COMPILE) -c $(TDEFAULTS) $(srcdir)/archures.c +dwarf2.lo: dwarf2.c Makefile + $(LIBTOOL) --mode=compile $(COMPILE) -c -DDEBUGDIR=\"$(DEBUGDIR)\" $(srcdir)/dwarf2.c + elf32-target.h : elfxx-target.h rm -f elf32-target.h sed -e s/NN/32/g < $(srcdir)/elfxx-target.h > elf32-target.new diff --git a/bfd/configure b/bfd/configure index 6abb2ada0..901d406b8 100755 --- a/bfd/configure +++ b/bfd/configure @@ -458,7 +458,7 @@ ac_includes_default="\ # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE AR ac_ct_AR RANLIB ac_ct_RANLIB LIBTOOL SED EGREP FGREP GREP LD DUMPBIN ac_ct_DUMPBIN NM LN_S lt_ECHO CPP PKGVERSION REPORT_BUGS_TO REPORT_BUGS_TEXI WARN_CFLAGS NO_WERROR MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT GENINSRC_NEVER_TRUE GENINSRC_NEVER_FALSE INSTALL_LIBBFD_TRUE INSTALL_LIBBFD_FALSE host_noncanonical target_noncanonical bfdlibdir bfdincludedir USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT MKINSTALLDIRS MSGFMT MSGMERGE HDEFINES BFD_HOST_64BIT_LONG BFD_HOST_LONG_LONG BFD_HOST_64_BIT_DEFINED BFD_HOST_64_BIT BFD_HOST_U_64_BIT CC_FOR_BUILD EXEEXT_FOR_BUILD COREFILE COREFLAG WIN32LDFLAGS WIN32LIBADD TDEFINES wordsize bfd64_libs all_backends bfd_backends bfd_machines bfd_default_target_size bfd_file_ptr bfd_ufile_ptr tdefaults datarootdir docdir htmldir LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE AR ac_ct_AR RANLIB ac_ct_RANLIB LIBTOOL SED EGREP FGREP GREP LD DUMPBIN ac_ct_DUMPBIN NM LN_S lt_ECHO CPP DEBUGDIR PKGVERSION REPORT_BUGS_TO REPORT_BUGS_TEXI WARN_CFLAGS NO_WERROR MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT GENINSRC_NEVER_TRUE GENINSRC_NEVER_FALSE INSTALL_LIBBFD_TRUE INSTALL_LIBBFD_FALSE host_noncanonical target_noncanonical bfdlibdir bfdincludedir USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT MKINSTALLDIRS MSGFMT MSGMERGE HDEFINES BFD_HOST_64BIT_LONG BFD_HOST_LONG_LONG BFD_HOST_64_BIT_DEFINED BFD_HOST_64_BIT BFD_HOST_U_64_BIT CC_FOR_BUILD EXEEXT_FOR_BUILD COREFILE COREFLAG WIN32LDFLAGS WIN32LIBADD TDEFINES wordsize bfd64_libs all_backends bfd_backends bfd_machines bfd_default_target_size bfd_file_ptr bfd_ufile_ptr tdefaults datarootdir docdir htmldir LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -1026,6 +1026,9 @@ Optional Packages: both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-mmap try using mmap for BFD input files if available + --with-separate-debug-dir=DIR + Look for global separate debug info in DIR + [default=LIBDIR/debug] --with-pkgversion=PKG Use PKG in the version string in place of "GNU Binutils" --with-bugurl=URL Direct users to URL to report a bug @@ -4662,13 +4665,13 @@ if test "${lt_cv_nm_interface+set}" = set; then else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:4665: $ac_compile\"" >&5) + (eval echo "\"\$as_me:4668: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 - (eval echo "\"\$as_me:4668: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval echo "\"\$as_me:4671: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 - (eval echo "\"\$as_me:4671: output\"" >&5) + (eval echo "\"\$as_me:4674: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" @@ -5723,7 +5726,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 5726 "configure"' > conftest.$ac_ext + echo '#line 5729 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -6823,11 +6826,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6826: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6829: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:6830: \$? = $ac_status" >&5 + echo "$as_me:6833: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -7145,11 +7148,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7148: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7151: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7152: \$? = $ac_status" >&5 + echo "$as_me:7155: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -7250,11 +7253,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7253: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7256: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:7257: \$? = $ac_status" >&5 + echo "$as_me:7260: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -7305,11 +7308,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7308: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7311: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:7312: \$? = $ac_status" >&5 + echo "$as_me:7315: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -10102,7 +10105,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10105 "configure" +#line 10108 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -10202,7 +10205,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10205 "configure" +#line 10208 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -10501,6 +10504,16 @@ _ACEOF fi +DEBUGDIR=${libdir}/debug + + +# Check whether --with-separate-debug-dir or --without-separate-debug-dir was given. +if test "${with_separate_debug_dir+set}" = set; then + withval="$with_separate_debug_dir" + DEBUGDIR="${withval}" +fi; + + # Check whether --with-pkgversion or --without-pkgversion was given. @@ -21073,6 +21086,7 @@ s,@NM@,$NM,;t t s,@LN_S@,$LN_S,;t t s,@lt_ECHO@,$lt_ECHO,;t t s,@CPP@,$CPP,;t t +s,@DEBUGDIR@,$DEBUGDIR,;t t s,@PKGVERSION@,$PKGVERSION,;t t s,@REPORT_BUGS_TO@,$REPORT_BUGS_TO,;t t s,@REPORT_BUGS_TEXI@,$REPORT_BUGS_TEXI,;t t diff --git a/bfd/configure.in b/bfd/configure.in index 0954bc5a7..770bb65a0 100644 --- a/bfd/configure.in +++ b/bfd/configure.in @@ -66,6 +66,14 @@ if test $use_secureplt = true; then [Define if we should default to creating read-only plt entries]) fi +DEBUGDIR=${libdir}/debug + +AC_ARG_WITH(separate-debug-dir, + AS_HELP_STRING([--with-separate-debug-dir=DIR], + [Look for global separate debug info in DIR [[default=LIBDIR/debug]]]), +[DEBUGDIR="${withval}"]) +AC_SUBST(DEBUGDIR) + ACX_PKGVERSION([GNU Binutils]) ACX_BUGURL([http://www.sourceware.org/bugzilla/]) diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c index 18d139cbe..2ba3152d5 100644 --- a/bfd/dwarf2.c +++ b/bfd/dwarf2.c @@ -2378,7 +2378,7 @@ _bfd_dwarf2_find_nearest_line (bfd *abfd, msec = find_debug_info (abfd, NULL); if (msec == NULL) { - char * debug_filename = bfd_follow_gnu_debuglink (abfd, NULL); + char * debug_filename = bfd_follow_gnu_debuglink (abfd, DEBUGDIR); if (debug_filename == NULL) /* No dwarf2 info, and no gnu_debuglink to follow. @@ -2617,7 +2617,7 @@ _bfd_dwarf2_find_line (bfd *abfd, msec = find_debug_info (abfd, NULL); if (msec == NULL) { - char * debug_filename = bfd_follow_gnu_debuglink (abfd, NULL); + char * debug_filename = bfd_follow_gnu_debuglink (abfd, DEBUGDIR); if (debug_filename == NULL) /* No dwarf2 info, and no gnu_debuglink to follow. -- 2.11.4.GIT