* elf32-i386 (elf_i386_adjust_dynamic_symbol): Do not replace PLT32
[deliverable/binutils-gdb.git] / bfd / elflink.h
index 9a3bfd3885b88c1151d2f9c10f6bf3c8d0bb70cf..47927d3830e46e6468cc415b1c5fe573b8415b8b 100644 (file)
@@ -1568,8 +1568,7 @@ elf_link_add_object_symbols (abfd, info)
         SEC_NEVER_LOAD flag is not the one we want, because that one
         still implies that the section takes up space in the output
         file.  */
-      abfd->sections = NULL;
-      abfd->section_count = 0;
+      bfd_section_list_clear (abfd);
 
       /* If this is the first dynamic object found in the link, create
         the special sections required for dynamic linking.  */
@@ -2057,10 +2056,7 @@ elf_link_add_object_symbols (abfd, info)
              {
              case STV_INTERNAL:
              case STV_HIDDEN:
-               h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL;
-               (*bed->elf_backend_hide_symbol) (info, h);
-               _bfd_elf_strtab_delref (hash_table->dynstr,
-                                       h->dynstr_index);
+               (*bed->elf_backend_hide_symbol) (info, h, true);
                break;
              }
 
@@ -3874,16 +3870,13 @@ elf_fix_symbol_flags (h, eif)
       && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0)
     {
       struct elf_backend_data *bed;
+      boolean force_local;
 
       bed = get_elf_backend_data (elf_hash_table (eif->info)->dynobj);
-      if (ELF_ST_VISIBILITY (h->other) == STV_INTERNAL
-         || ELF_ST_VISIBILITY (h->other) == STV_HIDDEN)
-       {
-         h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL;
-         _bfd_elf_strtab_delref (elf_hash_table (eif->info)->dynstr,
-                                 h->dynstr_index);
-       }
-      (*bed->elf_backend_hide_symbol) (eif->info, h);
+
+      force_local = (ELF_ST_VISIBILITY (h->other) == STV_INTERNAL
+                    || ELF_ST_VISIBILITY (h->other) == STV_HIDDEN);
+      (*bed->elf_backend_hide_symbol) (eif->info, h, force_local);
     }
 
   /* If this is a weak defined symbol in a dynamic object, and we know
@@ -4234,7 +4227,7 @@ elf_link_assign_sym_version (h, data)
              struct bfd_elf_version_expr *d;
 
              len = p - h->root.root.string;
-             alc = bfd_alloc (sinfo->output_bfd, (bfd_size_type) len);
+             alc = bfd_malloc ((bfd_size_type) len);
              if (alc == NULL)
                return false;
              strncpy (alc, h->root.root.string, len - 1);
@@ -4265,10 +4258,7 @@ elf_link_assign_sym_version (h, data)
                              && info->shared
                              && ! info->export_dynamic)
                            {
-                             h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL;
-                             (*bed->elf_backend_hide_symbol) (info, h);
-                             _bfd_elf_strtab_delref (elf_hash_table (info)->dynstr,
-                                                     h->dynstr_index);
+                             (*bed->elf_backend_hide_symbol) (info, h, true);
                            }
 
                          break;
@@ -4276,7 +4266,7 @@ elf_link_assign_sym_version (h, data)
                    }
                }
 
-             bfd_release (sinfo->output_bfd, alc);
+             free (alc);
              break;
            }
        }
@@ -4380,10 +4370,7 @@ elf_link_assign_sym_version (h, data)
                          && info->shared
                          && ! info->export_dynamic)
                        {
-                         h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL;
-                         (*bed->elf_backend_hide_symbol) (info, h);
-                         _bfd_elf_strtab_delref (elf_hash_table (info)->dynstr,
-                                                 h->dynstr_index);
+                         (*bed->elf_backend_hide_symbol) (info, h, true);
                        }
                      break;
                    }
@@ -4401,10 +4388,7 @@ elf_link_assign_sym_version (h, data)
              && info->shared
              && ! info->export_dynamic)
            {
-             h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL;
-             (*bed->elf_backend_hide_symbol) (info, h);
-             _bfd_elf_strtab_delref (elf_hash_table (info)->dynstr,
-                                     h->dynstr_index);
+             (*bed->elf_backend_hide_symbol) (info, h, true);
            }
        }
     }
This page took 0.024504 seconds and 4 git commands to generate.