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]

bfd_make_section


Near the end of 2001, I modified bfd to use a hash table for searches
of sections by name.  In the process, the return from bfd_make_section
on finding an existing section, was accidentally changed.  This function
is supposed to return NULL when the section already exists, to catch
places where it's an error to try to make a section twice.

This fix will almost certainly expose errors in some ports, as I found
with ppc32 trying to create .rela.got twice.  If you see new ld
testsuite failures, particularly bootstrap ones, it's probably due to
the same thing.

	* section.c (bfd_make_section): Return NULL for existing section.

Index: bfd/section.c
===================================================================
RCS file: /cvs/src/src/bfd/section.c,v
retrieving revision 1.57
diff -u -p -r1.57 section.c
--- bfd/section.c	29 Jun 2003 10:06:39 -0000	1.57
+++ bfd/section.c	4 Jul 2003 02:00:16 -0000
@@ -1001,7 +1001,7 @@ bfd_make_section (bfd *abfd, const char 
   if (newsect->name != NULL)
     {
       /* Section already exists.  */
-      return newsect;
+      return NULL;
     }
 
   newsect->name = name;

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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