public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Alan Modra <amodra@bigpond.net.au>
To: binutils@sources.redhat.com
Subject: bfd_make_section
Date: Fri, 04 Jul 2003 04:15:00 -0000	[thread overview]
Message-ID: <20030704041256.GL957@bubble.sa.bigpond.net.au> (raw)

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

             reply	other threads:[~2003-07-04  4:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-04  4:15 Alan Modra [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030704041256.GL957@bubble.sa.bigpond.net.au \
    --to=amodra@bigpond.net.au \
    --cc=binutils@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).