* pe-dll.c: Warning fixes.

* emultempl/sunos.em: Likewise.
This commit is contained in:
Alan Modra 2005-02-23 12:30:48 +00:00
parent 2132e3a318
commit 476391821e
3 changed files with 18 additions and 12 deletions

View file

@ -1,3 +1,8 @@
2005-02-23 Alan Modra <amodra@bigpond.net.au>
* pe-dll.c: Warning fixes.
* emultempl/sunos.em: Likewise.
2005-02-22 Daniel Jacobowitz <dan@codesourcery.com> 2005-02-22 Daniel Jacobowitz <dan@codesourcery.com>
* ldlang.c (section_already_linked): Don't call * ldlang.c (section_already_linked): Don't call

View file

@ -10,7 +10,7 @@ cat >e${EMULATION_NAME}.c <<EOF
/* SunOS emulation code for ${EMULATION_NAME} /* SunOS emulation code for ${EMULATION_NAME}
Copyright 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002, Copyright 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002,
2003, 2004 Free Software Foundation, Inc. 2003, 2004, 2005 Free Software Foundation, Inc.
Written by Steve Chamberlain <sac@cygnus.com> Written by Steve Chamberlain <sac@cygnus.com>
SunOS shared library support by Ian Lance Taylor <ian@cygnus.com> SunOS shared library support by Ian Lance Taylor <ian@cygnus.com>
@ -917,7 +917,7 @@ gld${EMULATION_NAME}_set_need (lang_input_statement_type *inp)
bfd_put_32 (output_bfd, (bfd_vma) 0, need_pinfo + 4); bfd_put_32 (output_bfd, (bfd_vma) 0, need_pinfo + 4);
bfd_put_16 (output_bfd, (bfd_vma) 0, need_pinfo + 8); bfd_put_16 (output_bfd, (bfd_vma) 0, need_pinfo + 8);
bfd_put_16 (output_bfd, (bfd_vma) 0, need_pinfo + 10); bfd_put_16 (output_bfd, (bfd_vma) 0, need_pinfo + 10);
strcpy (need_pnames, inp->filename); strcpy ((char *) need_pnames, inp->filename);
} }
else else
{ {
@ -932,7 +932,7 @@ gld${EMULATION_NAME}_set_need (lang_input_statement_type *inp)
sscanf (verstr, ".so.%d.%d", &maj, &min); sscanf (verstr, ".so.%d.%d", &maj, &min);
bfd_put_16 (output_bfd, (bfd_vma) maj, need_pinfo + 8); bfd_put_16 (output_bfd, (bfd_vma) maj, need_pinfo + 8);
bfd_put_16 (output_bfd, (bfd_vma) min, need_pinfo + 10); bfd_put_16 (output_bfd, (bfd_vma) min, need_pinfo + 10);
strcpy (need_pnames, inp->local_sym_name + 2); strcpy ((char *) need_pnames, inp->local_sym_name + 2);
} }
c = (need_pinfo - need_contents) / NEED_ENTRY_SIZE; c = (need_pinfo - need_contents) / NEED_ENTRY_SIZE;
@ -943,7 +943,7 @@ gld${EMULATION_NAME}_set_need (lang_input_statement_type *inp)
need_pinfo + 12); need_pinfo + 12);
need_pinfo += NEED_ENTRY_SIZE; need_pinfo += NEED_ENTRY_SIZE;
need_pnames += strlen (need_pnames) + 1; need_pnames += strlen ((char *) need_pnames) + 1;
} }
} }

View file

@ -1,5 +1,5 @@
/* Routines to help build PEI-format DLLs (Win32 etc) /* 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. Free Software Foundation, Inc.
Written by DJ Delorie <dj@cygnus.com> 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 *eaddresses;
unsigned char *enameptrs; unsigned char *enameptrs;
unsigned char *eordinals; unsigned char *eordinals;
unsigned char *enamestr; char *enamestr;
time_t now; time_t now;
time (&now); time (&now);
@ -932,7 +932,7 @@ fill_edata (bfd *abfd, struct bfd_link_info *info ATTRIBUTE_UNUSED)
eaddresses = edata_d + 40; eaddresses = edata_d + 40;
enameptrs = eaddresses + 4 * export_table_size; enameptrs = eaddresses + 4 * export_table_size;
eordinals = enameptrs + 4 * count_exported_byname; 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) \ #define ERVA(ptr) (((unsigned char *)(ptr) - edata_d) \
+ edata_s->output_section->vma - image_base) + edata_s->output_section->vma - image_base)
@ -1671,7 +1671,7 @@ make_tail (bfd *parent)
bfd_set_section_size (abfd, id7, len); bfd_set_section_size (abfd, id7, len);
d7 = xmalloc (len); d7 = xmalloc (len);
id7->contents = d7; id7->contents = d7;
strcpy (d7, dll_filename); strcpy ((char *) d7, dll_filename);
bfd_set_symtab (abfd, symtab, symptr); bfd_set_symtab (abfd, symtab, symptr);
@ -1894,7 +1894,7 @@ make_one (def_file_export *exp, bfd *parent)
memset (d6, 0, len); memset (d6, 0, len);
d6[0] = exp->hint & 0xff; d6[0] = exp->hint & 0xff;
d6[1] = exp->hint >> 8; d6[1] = exp->hint >> 8;
strcpy (d6 + 2, exp->name); strcpy ((char *) d6 + 2, exp->name);
} }
bfd_set_symtab (abfd, symtab, symptr); bfd_set_symtab (abfd, symtab, symptr);
@ -2427,7 +2427,8 @@ pe_implied_import_dll (const char *filename)
unsigned long pe_header_offset, opthdr_ofs, num_entries, i; unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
unsigned long export_rva, export_size, nsections, secptr, expptr; unsigned long export_rva, export_size, nsections, secptr, expptr;
unsigned long exp_funcbase; unsigned long exp_funcbase;
unsigned char *expdata, *erva; unsigned char *expdata;
char *erva;
unsigned long name_rvas, ordinals, nexp, ordbase; unsigned long name_rvas, ordinals, nexp, ordbase;
const char *dll_name; const char *dll_name;
/* Initialization with start > end guarantees that is_data /* Initialization with start > end guarantees that is_data
@ -2537,7 +2538,7 @@ pe_implied_import_dll (const char *filename)
expdata = xmalloc (export_size); expdata = xmalloc (export_size);
bfd_seek (dll, (file_ptr) expptr, SEEK_SET); bfd_seek (dll, (file_ptr) expptr, SEEK_SET);
bfd_bread (expdata, (bfd_size_type) export_size, dll); bfd_bread (expdata, (bfd_size_type) export_size, dll);
erva = expdata - export_rva; erva = (char *) expdata - export_rva;
if (pe_def_file == 0) if (pe_def_file == 0)
pe_def_file = def_file_empty (); pe_def_file = def_file_empty ();
@ -2550,7 +2551,7 @@ pe_implied_import_dll (const char *filename)
/* Use internal dll name instead of filename /* Use internal dll name instead of filename
to enable symbolic dll linking. */ 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 /* Check to see if the dll has already been added to
the definition list and if so return without error. the definition list and if so return without error.