Delete unused elf32-ppc.c code
authorAlan Modra <amodra@gmail.com>
Mon, 19 Mar 2018 09:49:50 +0000 (20:19 +1030)
committerAlan Modra <amodra@gmail.com>
Wed, 21 Mar 2018 11:13:38 +0000 (21:43 +1030)
Local symbols were being read but not used.

* elf32-ppc.c (ppc_elf_tls_optimize): Delete locsyms.

bfd/ChangeLog
bfd/elf32-ppc.c

index 646bb4f44fcf4b1582969c3b27eb24cb64eef104..9885d2dea59fe21b43e4db111c1b5f67a5cb8b20 100644 (file)
@@ -1,3 +1,7 @@
+2018-03-21  Alan Modra  <amodra@gmail.com>
+
+       * elf32-ppc.c (ppc_elf_tls_optimize): Delete locsyms.
+
 2018-03-21  Alan Modra  <amodra@gmail.com>
 
        * elf32-ppc.c (struct ppc_elf_link_hash_entry): Make tls_mask
index e0456b886fc8979b1d958c90dfd1961fc1606b84..c82e405ca7d4ca86d2b8a27525874a9284ff11cc 100644 (file)
@@ -5190,7 +5190,6 @@ ppc_elf_tls_optimize (bfd *obfd ATTRIBUTE_UNUSED,
   for (pass = 0; pass < 2; ++pass)
     for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
       {
-       Elf_Internal_Sym *locsyms = NULL;
        Elf_Internal_Shdr *symtab_hdr = &elf_symtab_hdr (ibfd);
        asection *got2 = bfd_get_section_by_name (ibfd, ".got2");
 
@@ -5370,20 +5369,6 @@ ppc_elf_tls_optimize (bfd *obfd ATTRIBUTE_UNUSED,
                      struct plt_entry **local_plt;
                      unsigned char *lgot_masks;
 
-                     if (locsyms == NULL)
-                       {
-                         locsyms = (Elf_Internal_Sym *) symtab_hdr->contents;
-                         if (locsyms == NULL)
-                           locsyms = bfd_elf_get_elf_syms (ibfd, symtab_hdr,
-                                                           symtab_hdr->sh_info,
-                                                           0, NULL, NULL, NULL);
-                         if (locsyms == NULL)
-                           {
-                             if (elf_section_data (sec)->relocs != relstart)
-                               free (relstart);
-                             return FALSE;
-                           }
-                       }
                      lgot_refs = elf_local_got_refcounts (ibfd);
                      if (lgot_refs == NULL)
                        abort ();
@@ -5409,15 +5394,6 @@ ppc_elf_tls_optimize (bfd *obfd ATTRIBUTE_UNUSED,
              if (elf_section_data (sec)->relocs != relstart)
                free (relstart);
            }
-
-       if (locsyms != NULL
-           && (symtab_hdr->contents != (unsigned char *) locsyms))
-         {
-           if (!info->keep_memory)
-             free (locsyms);
-           else
-             symtab_hdr->contents = (unsigned char *) locsyms;
-         }
       }
   htab->do_tls_opt = 1;
   return TRUE;