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]

Re: bfd_make_section_anyway error recovery buglet


On Tue, Nov 13, 2001 at 01:53:23PM +1030, Alan Modra wrote:
> On Tue, Nov 13, 2001 at 12:18:38AM +0000, John Marshall wrote:
> > 	section.c (bfd_make_section_anyway): Don't increment section_id and
> > 	the BFD's section_count if adding the section failed.
> 
> Thanks.  Applying.

Err, with this tweak to bfd/vms.c.

	* vms.c (vms_new_section_hook): Adjust for bfd_make_section_anyway
	change.

Index: bfd/vms.c
===================================================================
RCS file: /cvs/src/src/bfd/vms.c,v
retrieving revision 1.14
diff -u -p -r1.14 vms.c
--- vms.c	2001/09/18 09:57:26	1.14
+++ vms.c	2001/11/13 03:44:40
@@ -733,19 +733,23 @@ vms_new_section_hook (abfd, section)
      bfd *abfd;
      asection *section;
 {
+  /* Count hasn't been incremented yet.  */
+  unsigned int section_count = abfd->section_count + 1;
+
 #if VMS_DEBUG
-  vms_debug (1, "vms_new_section_hook (%p, [%d]%s), count %d\n", abfd, section->index, section->name, abfd->section_count);
+  vms_debug (1, "vms_new_section_hook (%p, [%d]%s), count %d\n",
+	     abfd, section->index, section->name, section_count);
 #endif
-  bfd_set_section_alignment(abfd, section, 4);
+  bfd_set_section_alignment (abfd, section, 4);
 
-  if (abfd->section_count > PRIV (section_count))
+  if (section_count > PRIV (section_count))
     {
-      bfd_size_type amt = abfd->section_count;
+      bfd_size_type amt = section_count;
       amt *= sizeof (asection *);
       PRIV (sections) = (asection **) bfd_realloc (PRIV (sections), amt);
       if (PRIV (sections) == 0)
 	return false;
-      PRIV (section_count) = abfd->section_count;
+      PRIV (section_count) = section_count;
     }
 #if VMS_DEBUG
   vms_debug (6, "section_count: %d\n", PRIV (section_count));


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