This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
strip crashes on MSVC generated object files
- From: Christian Groessler <chris at groessler dot org>
- To: binutils at sources dot redhat dot com
- Cc: chris at groessler dot org
- Date: 18 Feb 2005 14:47:52 +0100
- Subject: strip crashes on MSVC generated object files
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 <chris@groessler.org>
* 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