From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2943 invoked by alias); 18 Feb 2005 13:47:49 -0000 Mailing-List: contact binutils-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sources.redhat.com Received: (qmail 2849 invoked from network); 18 Feb 2005 13:47:40 -0000 Received: from unknown (HELO strommasten.groessler.org) (213.133.97.36) by sourceware.org with SMTP; 18 Feb 2005 13:47:40 -0000 Received: from strommasten.groessler.org.groessler.org (localhost [127.0.0.1]) by strommasten.groessler.org (8.11.6p3/8.11.6) with ESMTP id j1IDls523471; Fri, 18 Feb 2005 14:47:55 +0100 (CET) To: binutils@sources.redhat.com Cc: chris@groessler.org Subject: strip crashes on MSVC generated object files From: Christian Groessler Date: Fri, 18 Feb 2005 21:32:00 -0000 Message-ID: <87zmy2ughj.fsf@strommasten.groessler.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2005-02/txt/msg00439.txt.bz2 Hi, current CVS strip targetted for i686-mingw32 crashes when stripping MSVC generated object files. It happens for example when using the --strip-debug option. I've put a demo object file on ftp://ftp.groessler.org/pub/chris/tmp/strip-crash.zip (blavc.obj). These MSVC object files have an additional .drectve section which might trigger the problem. What happens is that coffgen.c(bfd_coff_get_comdat_section) gets called with an *ABS* section and then crashes when dereferencing used_by_bfd (in coff_section_data). I've attached a patch to workaround the issue, but it's probably more curing the symptoms instead of the disease? regards, chris 2005-02-18 Christian Groessler * coffgen.c (bfd_coff_get_comdat_section): Do not call coff_section_data for *ABS* sections. Index: bfd/coffgen.c =================================================================== RCS file: /cvs/src/src/bfd/coffgen.c,v retrieving revision 1.46 diff -p -u -r1.46 coffgen.c --- bfd/coffgen.c 31 Jan 2005 23:13:17 -0000 1.46 +++ bfd/coffgen.c 18 Feb 2005 13:23:15 -0000 @@ -2427,6 +2427,8 @@ bfd_coff_set_symbol_class (abfd, symbol, struct coff_comdat_info * bfd_coff_get_comdat_section (bfd *abfd, struct bfd_section *sec) { + if (strcmp (sec->name, BFD_ABS_SECTION_NAME) == 0) + return NULL; if (bfd_get_flavour (abfd) == bfd_target_coff_flavour) return coff_section_data (abfd, sec)->comdat; else