public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* bfd_make_section
@ 2003-07-04  4:15 Alan Modra
  2003-07-04  4:57 ` bfd_make_section Alan Modra
  0 siblings, 1 reply; 6+ messages in thread
From: Alan Modra @ 2003-07-04  4:15 UTC (permalink / raw)
  To: binutils

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2003-07-04  8:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-04  4:15 bfd_make_section Alan Modra
2003-07-04  4:57 ` bfd_make_section Alan Modra
2003-07-04  6:16   ` bfd_make_section kaz Kojima
2003-07-04  7:42     ` bfd_make_section Alan Modra
2003-07-04  8:20       ` bfd_make_section kaz Kojima
2003-07-04  8:42         ` bfd_make_section kaz Kojima

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).