[PATCH, microblaze/ld] Reuse .rela.got section

Michael Eager eager@eagerm.com
Fri Jan 27 16:49:00 GMT 2012


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



More information about the Binutils mailing list