or1k: Do not override section for non-TLS symbols.
authorChristian Svensson <blue@cmd.nu>
Mon, 28 Apr 2014 22:34:59 +0000 (00:34 +0200)
committerChristian Svensson <blue@cmd.nu>
Tue, 29 Apr 2014 14:36:32 +0000 (16:36 +0200)
Outgoing section for relocations was computed by setting a shared
pointer to which section should be used. For TLS this was overriden to
use .rela.got since they use GOT entries but since the pointer is per
section that whole section was relocated to .rela.got, even non-TLS
relocations.

* elf32-or1k.c: Fix a bug where non-TLS relocations would be forced
into .rela.got if it contained TLS relocations as well.

bfd/ChangeLog
bfd/elf32-or1k.c

index 2a1642d1576b521fa0ee6276a659b8a90e7c56ab..5eb59d3270786ea57afebccc65b18a11832efa26 100644 (file)
@@ -1,3 +1,8 @@
+2014-04-29  Christian Svensson  <blue@cmd.nu>
+
+       * elf32-or1k.c: Fix a bug where non-TLS relocations would be forced
+       into .rela.got if it contained TLS relocations as well.
+
 2014-04-28  Nick Clifton  <nickc@redhat.com>
 
        PR ld/16821
index c7f1875c4b063689883d4780bbc19ac34c9d2973..9aa5f543626db2109bbb5b8c53926ac93c82d810 100644 (file)
@@ -1112,6 +1112,8 @@ or1k_elf_relocate_section (bfd *output_bfd,
             bfd_byte *loc;
             int dynamic;
 
+            sreloc = bfd_get_section_by_name (dynobj, ".rela.got");
+
             /* Mark as TLS related GOT entry by setting
                bit 2 as well as bit 1.  */
             if (h != NULL)
@@ -1541,15 +1543,6 @@ or1k_elf_check_relocs (bfd *abfd,
                 return FALSE;
             }
 
-          /* TLS specific.  */
-          if (ELF32_R_TYPE (rel->r_info) >= R_OR1K_TLS_GD_HI16 &&
-              ELF32_R_TYPE (rel->r_info) <= R_OR1K_TLS_IE_LO16)
-            {
-              /* Set which rela section to use.  */
-              elf_section_data (sec)->sreloc =
-                bfd_get_section_by_name (dynobj, ".rela.got");;
-            }
-
           if (ELF32_R_TYPE (rel->r_info) != R_OR1K_GOTOFF_HI16 &&
               ELF32_R_TYPE (rel->r_info) != R_OR1K_GOTOFF_LO16)
             {
This page took 0.02762 seconds and 4 git commands to generate.