public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Michael Eager <eager@eagerm.com>
To: binutils <binutils@sourceware.org>
Subject: [PATCH, microblaze/ld] Reuse .rela.got section
Date: Fri, 27 Jan 2012 16:49:00 -0000	[thread overview]
Message-ID: <4F22D56E.5030903@eagerm.com> (raw)

The linker was failing if the .rela.got section already existed.

2012-01-27  Michael Eager  <eager@eagercon.com>

	* bfd/elf32-microblaze.c (create_got_section):
	Reuse existing .rela.got section.

Index: bfd/elf32-microblaze.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-microblaze.c,v
retrieving revision 1.11
diff -u -p -r1.11 elf32-microblaze.c
--- bfd/elf32-microblaze.c      13 Jun 2011 00:59:10 -0000      1.11
+++ bfd/elf32-microblaze.c      27 Jan 2012 16:41:45 -0000
@@ -1880,7 +1880,8 @@ create_got_section (bfd *dynobj, struct
    if (!htab->sgot || !htab->sgotplt)
      return FALSE;

-  htab->srelgot = bfd_make_section (dynobj, ".rela.got");
+  if (!(htab->srelgot = bfd_get_section_by_name (dynobj, ".rela.got")))
+    htab->srelgot = bfd_make_section (dynobj, ".rela.got");
    if (htab->srelgot == NULL
        || ! bfd_set_section_flags (dynobj, htab->srelgot, SEC_ALLOC
                                    | SEC_LOAD

Applied.

-- 
Michael Eager	 eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306  650-325-8077

                 reply	other threads:[~2012-01-27 16:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=4F22D56E.5030903@eagerm.com \
    --to=eager@eagerm.com \
    --cc=binutils@sourceware.org \
    /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).