Matthias Klose wrote:

> not sure why c++filt needs to be diverted.

It shouldn’t be.

$ ldd /usr/bin/c++filt | grep bfd
        libbfd-2.20.51-multiarch.20100415.so => 
/usr/lib/libbfd-2.20.51-multiarch.20100415.so (0xb74b6000)
$ readelf --dyn-syms /usr/bin/c++filt | grep bfd_
     5: 00000000     0 FUNC    GLOBAL DEFAULT  UND bfd_get_error
    20: 00000000     0 FUNC    GLOBAL DEFAULT  UND bfd_printable_arch_mach
    24: 00000000     0 FUNC    GLOBAL DEFAULT  UND bfd_close_all_done
    30: 00000000     0 FUNC    GLOBAL DEFAULT  UND bfd_target_list
    32: 00000000     0 FUNC    GLOBAL DEFAULT  UND bfd_openw
    34: 00000000     0 FUNC    GLOBAL DEFAULT  UND bfd_errmsg
    45: 00000000     0 FUNC    GLOBAL DEFAULT  UND bfd_set_default_target
    50: 00000000     0 FUNC    GLOBAL DEFAULT  UND bfd_malloc
    52: 00000000     0 FUNC    GLOBAL DEFAULT  UND bfd_scan_vma
    54: 00000000     0 FUNC    GLOBAL DEFAULT  UND bfd_arch_list
    55: 00000000     0 FUNC    GLOBAL DEFAULT  UND bfd_set_format
    70: 0804c220     4 OBJECT  GLOBAL DEFAULT   25 bfd_target_vector

That all comes from the common code in bucomm.c, which is only used
to provide program_name() and fatal().

Ideally, c++filt should not be linked against libbfd at all.  This
patch confirms that that would work.

Thanks for noticing.

diff --git a/binutils/Makefile.am b/binutils/Makefile.am
index 001bbe5..8f81ed9 100644
--- a/binutils/Makefile.am
+++ b/binutils/Makefile.am
@@ -170,7 +170,7 @@ ar_DEPENDENCIES =        $(LIBINTL_DEP) $(LIBIBERTY) 
$(BFDLIB)
 strings_DEPENDENCIES =   $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
 strip_new_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
 ranlib_DEPENDENCIES =    $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
-cxxfilt_DEPENDENCIES =   $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
+cxxfilt_DEPENDENCIES =   $(LIBINTL_DEP) $(LIBIBERTY)
 objcopy_DEPENDENCIES =   $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
 nlmconv_DEPENDENCIES =   $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
 srconv_DEPENDENCIES =    $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
@@ -217,7 +217,8 @@ endif
        $(COMPILE) -c $(OBJDUMP_DEFS) $(srcdir)/objdump.c
 endif
 
-cxxfilt_SOURCES = cxxfilt.c $(BULIBS)
+cxxfilt_SOURCES = cxxfilt.c version.c
+cxxfilt_LDADD = $(LIBINTL) $(LIBIBERTY)
 
 ar_SOURCES = arparse.y arlex.l ar.c not-ranlib.c arsup.c rename.c binemul.c \
        emul_$(EMULATION).c $(BULIBS)
diff --git a/binutils/cxxfilt.c b/binutils/cxxfilt.c
index 770df9b..b72b6e3 100644
--- a/binutils/cxxfilt.c
+++ b/binutils/cxxfilt.c
@@ -30,6 +30,7 @@
 #include "safe-ctype.h"
 #include "bucomm.h"
 
+char *program_name;
 static int flags = DMGL_PARAMS | DMGL_ANSI | DMGL_VERBOSE;
 static int strip_underscore = TARGET_PREPENDS_UNDERSCORE;
 
@@ -250,7 +251,8 @@ main (int argc, char **argv)
       /* Folks should explicitly indicate the appropriate alphabet for
         each demangling.  Providing a default would allow the
         question to go unconsidered.  */
-      fatal ("Internal error: no symbol alphabet for current style");
+      fprintf (stderr, "Internal error: no symbol alphabet for current 
style\n");
+      xexit (1);
     }
 
   for (;;)
-- 



-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to