This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Re: 2.9.5.0.10 ld dumps core when /DISCARD/ is used
- To: hjl@lucon.org
- Subject: Re: 2.9.5.0.10 ld dumps core when /DISCARD/ is used
- From: Ian Lance Taylor <ian@zembu.com>
- Date: 3 Sep 1999 14:26:20 -0400
- CC: zack@bitmover.com, binutils@sourceware.cygnus.com
- References: <19990903181139.14C371B493@ocean.lucon.org>
Date: Fri, 3 Sep 1999 11:11:39 -0700 (PDT)
From: hjl@lucon.org (H.J. Lu)
I can verify the bug with today's cvs. Here is the patch.
Thanks. I wonder why I didn't see the problem.
Please try the appended patch instead. That tests the actual
characteristic we are interested in, rather than testing something
else and potentially covering up a different bug.
Incidentally, Mark, that code ought to be checking that the input file
is an ELF file before it calls elf_section_data.
Ian
Index: elflink.h
===================================================================
RCS file: /cvs/binutils/binutils/bfd/elflink.h,v
retrieving revision 1.27
diff -u -p -r1.27 elflink.h
--- elflink.h 1999/08/31 14:07:27 1.27
+++ elflink.h 1999/09/03 18:24:03
@@ -4036,7 +4036,12 @@ elf_bfd_final_link (abfd, info)
for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
for (o = sub->sections; o != NULL; o = o->next)
{
- asection* output_section = o->output_section;
+ asection* output_section;
+
+ if (! o->linker_mark)
+ continue;
+
+ output_section = o->output_section;
if (output_section && (o->flags & SEC_RELOC) != 0)
{