This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] SHF_MERGE fix


Hi!

If GC removes all input sections with the same name, SHF_STRINGS setting
and sh_entsize, we would segfault...
Ok to commit?

2002-03-04  Jakub Jelinek  <jakub@redhat.com>

	* merge.c (_bfd_merge_sections): Don't segfault if there
	is nothing to merge due to GC.

--- bfd/merge.c.jj	Mon Jan 14 17:53:10 2002
+++ bfd/merge.c	Mon Mar  4 16:20:55 2002
@@ -804,6 +804,9 @@ _bfd_merge_sections (abfd, xsinfo, remov
       if (secinfo)
 	continue;
 
+      if (sinfo->htab->first == NULL)
+	continue;
+
       if (sinfo->htab->strings)
 	merge_strings (sinfo);
       else

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]