This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: strip crashes on MSVC generated object files
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Christian Groessler <chris at groessler dot org>
- Cc: binutils at sources dot redhat dot com
- Date: Mon, 21 Feb 2005 21:51:27 +1030
- Subject: Re: strip crashes on MSVC generated object files
- References: <87zmy2ughj.fsf@strommasten.groessler.org>
On Fri, Feb 18, 2005 at 02:47:52PM +0100, Christian Groessler wrote:
> I've attached a patch to workaround the issue, but it's probably more
> curing the symptoms instead of the disease?
It's a reasonable thing to do. The disease in this case is that the
absolute input section isn't attached to each bfd that defines absolute
symbols. However, fixing that properly requires quite a large patch.
I'm committing a more direct approach than your patch. There are other
sections besides the absolute section that won't have coff_section_data.
* coffgen.c (bfd_coff_get_comdat_section): Check that
coff_section_data isn't NULL.
Index: bfd/coffgen.c
===================================================================
RCS file: /cvs/src/src/bfd/coffgen.c,v
retrieving revision 1.47
diff -u -p -r1.47 coffgen.c
--- bfd/coffgen.c 20 Feb 2005 14:59:06 -0000 1.47
+++ bfd/coffgen.c 21 Feb 2005 11:18:11 -0000
@@ -2427,7 +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 (bfd_get_flavour (abfd) == bfd_target_coff_flavour)
+ if (bfd_get_flavour (abfd) == bfd_target_coff_flavour
+ && coff_section_data (abfd, sec) != NULL)
return coff_section_data (abfd, sec)->comdat;
else
return NULL;
--
Alan Modra
IBM OzLabs - Linux Technology Centre