Fix typo.
[deliverable/binutils-gdb.git] / ld / pe-dll.c
index 46b0a1381f594c6d984755ef254db4b4b168bc5e..81834ec4c95ecd0013ea574956e322f3a7c99c4f 100644 (file)
@@ -1,5 +1,5 @@
 /* Routines to help build PEI-format DLLs (Win32 etc)
-   Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004
+   Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
    Free Software Foundation, Inc.
    Written by DJ Delorie <dj@cygnus.com>
 
@@ -920,7 +920,7 @@ fill_edata (bfd *abfd, struct bfd_link_info *info ATTRIBUTE_UNUSED)
   unsigned char *eaddresses;
   unsigned char *enameptrs;
   unsigned char *eordinals;
-  unsigned char *enamestr;
+  char *enamestr;
   time_t now;
 
   time (&now);
@@ -932,7 +932,7 @@ fill_edata (bfd *abfd, struct bfd_link_info *info ATTRIBUTE_UNUSED)
   eaddresses = edata_d + 40;
   enameptrs = eaddresses + 4 * export_table_size;
   eordinals = enameptrs + 4 * count_exported_byname;
-  enamestr = eordinals + 2 * count_exported_byname;
+  enamestr = (char *) eordinals + 2 * count_exported_byname;
 
 #define ERVA(ptr) (((unsigned char *)(ptr) - edata_d) \
                   + edata_s->output_section->vma - image_base)
@@ -1178,9 +1178,6 @@ generate_reloc (bfd *abfd, struct bfd_link_info *info)
          free (relocs);
          /* Warning: the allocated symbols are remembered in BFD and
             reused later, so don't free them!  */
-#if 0
-         free (symbol);
-#endif
        }
     }
 
@@ -1674,7 +1671,7 @@ make_tail (bfd *parent)
   bfd_set_section_size (abfd, id7, len);
   d7 = xmalloc (len);
   id7->contents = d7;
-  strcpy (d7, dll_filename);
+  strcpy ((char *) d7, dll_filename);
 
   bfd_set_symtab (abfd, symtab, symptr);
 
@@ -1897,7 +1894,7 @@ make_one (def_file_export *exp, bfd *parent)
       memset (d6, 0, len);
       d6[0] = exp->hint & 0xff;
       d6[1] = exp->hint >> 8;
-      strcpy (d6 + 2, exp->name);
+      strcpy ((char *) d6 + 2, exp->name);
     }
 
   bfd_set_symtab (abfd, symtab, symptr);
@@ -2037,9 +2034,6 @@ make_import_fixup_entry (const char *name,
   symtab = xmalloc (6 * sizeof (asymbol *));
   id3 = quick_section (abfd, ".idata$3", SEC_HAS_CONTENTS, 2);
 
-#if 0
-  quick_symbol (abfd, U ("_head_"), dll_symname, "", id2, BSF_GLOBAL, 0);
-#endif
   quick_symbol (abfd, U ("_nm_thnk_"), name, "", UNDSEC, BSF_GLOBAL, 0);
   quick_symbol (abfd, U (""), dll_symname, "_iname", UNDSEC, BSF_GLOBAL, 0);
   quick_symbol (abfd, "", fixup_name, "", UNDSEC, BSF_GLOBAL, 0);
@@ -2231,7 +2225,7 @@ pe_dll_generate_implib (def_file *def, const char *impfilename)
     if (!ISALNUM (dll_symname[i]))
       dll_symname[i] = '_';
 
-  unlink (impfilename);
+  unlink_if_ordinary (impfilename);
 
   outarch = bfd_openw (impfilename, 0);
 
@@ -2418,18 +2412,6 @@ pe_get32 (bfd *abfd, int where)
   return b[0] + (b[1] << 8) + (b[2] << 16) + (b[3] << 24);
 }
 
-#if 0 /* This is not currently used.  */
-
-static unsigned int
-pe_as16 (void *ptr)
-{
-  unsigned char *b = ptr;
-
-  return b[0] + (b[1] << 8);
-}
-
-#endif
-
 static unsigned int
 pe_as32 (void *ptr)
 {
@@ -2445,7 +2427,8 @@ pe_implied_import_dll (const char *filename)
   unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
   unsigned long export_rva, export_size, nsections, secptr, expptr;
   unsigned long exp_funcbase;
-  unsigned char *expdata, *erva;
+  unsigned char *expdata;
+  char *erva;
   unsigned long name_rvas, ordinals, nexp, ordbase;
   const char *dll_name;
   /* Initialization with start > end guarantees that is_data
@@ -2555,7 +2538,7 @@ pe_implied_import_dll (const char *filename)
   expdata = xmalloc (export_size);
   bfd_seek (dll, (file_ptr) expptr, SEEK_SET);
   bfd_bread (expdata, (bfd_size_type) export_size, dll);
-  erva = expdata - export_rva;
+  erva = (char *) expdata - export_rva;
 
   if (pe_def_file == 0)
     pe_def_file = def_file_empty ();
@@ -2568,7 +2551,7 @@ pe_implied_import_dll (const char *filename)
 
   /* Use internal dll name instead of filename
      to enable symbolic dll linking.  */
-  dll_name = pe_as32 (expdata + 12) + erva;
+  dll_name = erva + pe_as32 (expdata + 12);
 
   /* Check to see if the dll has already been added to
      the definition list and if so return without error.
This page took 0.052601 seconds and 4 git commands to generate.