Add prototypes for static functions.
[binutils-gdb.git] / bfd / elflink.h
index cde235454f56e64da28699220f0fd908feb74546..cbc18d94b7d8560abaf604cac51ce6203d35e804 100644 (file)
@@ -1,5 +1,5 @@
 /* ELF linker support.
-   Copyright 1995, 1996, 1997 Free Software Foundation, Inc.
+   Copyright 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
 
@@ -299,8 +299,6 @@ elf_merge_symbol (abfd, info, name, sym, psec, pvalue, sym_hash,
   boolean newdyn, olddyn, olddef, newdef, newdyncommon, olddyncommon;
 
   *override = false;
-  *type_change_ok = false;
-  *size_change_ok = false;
 
   sec = *psec;
   bind = ELF_ST_BIND (sym->st_info);
@@ -1098,7 +1096,7 @@ elf_link_add_object_symbols (abfd, info)
       if (info->hash->creator->flavour == bfd_target_elf_flavour)
        {
          Elf_Internal_Versym iver;
-         int vernum;
+         unsigned int vernum = 0;
          boolean override;
 
          if (ever != NULL)
@@ -1123,7 +1121,7 @@ elf_link_add_object_symbols (abfd, info)
                      if (vernum > elf_tdata (abfd)->dynverdef_hdr.sh_info)
                        {
                          (*_bfd_error_handler)
-                           ("%s: %s: invalid version %d (max %d)",
+                           (_("%s: %s: invalid version %u (max %d)"),
                             abfd->filename, name, vernum,
                             elf_tdata (abfd)->dynverdef_hdr.sh_info);
                          bfd_set_error (bfd_error_bad_value);
@@ -1164,7 +1162,7 @@ elf_link_add_object_symbols (abfd, info)
                      if (verstr == NULL)
                        {
                          (*_bfd_error_handler)
-                           ("%s: %s: invalid needed version %d",
+                           (_("%s: %s: invalid needed version %d"),
                             abfd->filename, name, vernum);
                          bfd_set_error (bfd_error_bad_value);
                          goto error_return;
@@ -1277,7 +1275,7 @@ elf_link_add_object_symbols (abfd, info)
            {
              if (h->size != 0 && h->size != sym.st_size && ! size_change_ok)
                (*_bfd_error_handler)
-                 ("Warning: size of symbol `%s' changed from %lu to %lu in %s",
+                 (_("Warning: size of symbol `%s' changed from %lu to %lu in %s"),
                   name, (unsigned long) h->size, (unsigned long) sym.st_size,
                   bfd_get_filename (abfd));
 
@@ -1299,7 +1297,7 @@ elf_link_add_object_symbols (abfd, info)
                  && h->type != ELF_ST_TYPE (sym.st_info)
                  && ! type_change_ok)
                (*_bfd_error_handler)
-                 ("Warning: type of symbol `%s' changed from %d to %d in %s",
+                 (_("Warning: type of symbol `%s' changed from %d to %d in %s"),
                   name, h->type, ELF_ST_TYPE (sym.st_info),
                   bfd_get_filename (abfd));
 
@@ -1372,6 +1370,8 @@ elf_link_add_object_symbols (abfd, info)
                      purposes of the merge, act as though we were
                      defining the symbol we just defined, although we
                      actually going to define an indirect symbol.  */
+                 type_change_ok = false;
+                 size_change_ok = false;
                  if (! elf_merge_symbol (abfd, info, shortname, &sym, &sec,
                                          &value, &hi, &override,
                                          &type_change_ok, &size_change_ok))
@@ -1510,6 +1510,8 @@ elf_link_add_object_symbols (abfd, info)
                  strcpy (shortname + (p - name), p + 1);
 
                  /* Once again, merge with any existing symbol.  */
+                 type_change_ok = false;
+                 size_change_ok = false;
                  if (! elf_merge_symbol (abfd, info, shortname, &sym, &sec,
                                          &value, &hi, &override,
                                          &type_change_ok, &size_change_ok))
@@ -1521,7 +1523,7 @@ elf_link_add_object_symbols (abfd, info)
                          don't expect to see the type of override we
                          do in the case above.  */
                      (*_bfd_error_handler)
-                       ("%s: warning: unexpected redefinition of `%s'",
+                       (_("%s: warning: unexpected redefinition of `%s'"),
                         bfd_get_filename (abfd), shortname);
                    }
                  else
@@ -2211,7 +2213,7 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath,
 
   *sinterpptr = NULL;
 
-  soname_indx = -1;
+  soname_indx = (bfd_size_type) -1;
 
   if (info->hash->creator->flavour != bfd_target_elf_flavour)
     return true;
@@ -2458,7 +2460,7 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath,
          def.vd_next = (sizeof (Elf_External_Verdef)
                         + sizeof (Elf_External_Verdaux));
 
-         if (soname_indx != -1)
+         if (soname_indx != (bfd_size_type) -1)
            {
              def.vd_hash = bfd_elf_hash ((const unsigned char *) soname);
              defaux.vda_name = soname_indx;
@@ -3217,7 +3219,7 @@ elf_link_assign_sym_version (h, data)
          /* We could not find the version for a symbol when
              generating a shared archive.  Return an error.  */
          (*_bfd_error_handler)
-           ("%s: undefined versioned symbol name %s",
+           (_("%s: undefined versioned symbol name %s"),
             bfd_get_filename (sinfo->output_bfd), h->root.root.string);
          bfd_set_error (bfd_error_bad_value);
          sinfo->failed = true;
@@ -5101,7 +5103,7 @@ elf_create_pointer_linker_section (abfd, info, lsect, h, rel)
       /* Allocate a table to hold the local symbols if first time */
       if (!ptr)
        {
-         int num_symbols = elf_tdata (abfd)->symtab_hdr.sh_info;
+         unsigned int num_symbols = elf_tdata (abfd)->symtab_hdr.sh_info;
          register unsigned int i;
 
          ptr = (elf_linker_section_pointers_t **)