* cofflink.c (_bfd_coff_final_link): Cast argument to bfd_h_put_32 to correct
authorKen Raeburn <raeburn@cygnus>
Mon, 10 Oct 1994 20:38:06 +0000 (20:38 +0000)
committerKen Raeburn <raeburn@cygnus>
Mon, 10 Oct 1994 20:38:06 +0000 (20:38 +0000)
type.
(coff_read_string_table): Cast argument to bfd_h_get_32 to correct type.
* elfcode.h (elf_link_output_extsym): Cast argument to bfd_elf_hash to correct
type.

bfd/ChangeLog
bfd/elfcode.h

index fc6da56..e062a10 100644 (file)
@@ -1,5 +1,12 @@
 Mon Oct 10 16:24:44 1994  Ken Raeburn  <raeburn@cujo.cygnus.com>
 
+       * cofflink.c (_bfd_coff_final_link): Cast argument to bfd_h_put_32
+       to correct type.
+       (coff_read_string_table): Cast argument to bfd_h_get_32 to correct
+       type.
+       * elfcode.h (elf_link_output_extsym): Cast argument to
+       bfd_elf_hash to correct type.
+
        * elf32-sparc.c (elf_sparc_howto_table): The PC10, PC22, and
        WPLT30 relocations are PC-relative.
 
index f7b456f..8662c7f 100644 (file)
@@ -2306,7 +2306,11 @@ swap_out_syms (abfd)
               and the size into the `size' field.  This is backwards from
               how BFD handles it, so reverse it here.  */
            sym.st_size = value;
-           sym.st_value = type_ptr ? type_ptr->internal_elf_sym.st_value : 16;
+           if (type_ptr == NULL
+               || type_ptr->internal_elf_sym.st_value == 0)
+             sym.st_value = value >= 16 ? 16 : (1 << bfd_log2 (value));
+           else
+             sym.st_value = type_ptr->internal_elf_sym.st_value;
            sym.st_shndx = elf_section_from_bfd_section (abfd,
                                                         syms[idx]->section);
          }
@@ -5916,7 +5920,7 @@ elf_link_output_extsym (h, data)
                            + h->dynindx));
 
       bucketcount = elf_hash_table (finfo->info)->bucketcount;
-      bucket = bfd_elf_hash (h->root.root.string) % bucketcount;
+      bucket = bfd_elf_hash ((const unsigned char *) h->root.root.string) % bucketcount;
       bucketpos = ((bfd_byte *) finfo->hash_sec->contents
                   + (bucket + 2) * (ARCH_SIZE / 8));
       chain = get_word (finfo->output_bfd, bucketpos);