* elf.c (_bfd_elf_link_hash_table_init): Make sure
authorAlexandre Oliva <aoliva@redhat.com>
Wed, 20 Nov 2002 18:17:04 +0000 (18:17 +0000)
committerAlexandre Oliva <aoliva@redhat.com>
Wed, 20 Nov 2002 18:17:04 +0000 (18:17 +0000)
can_refcount is properly extended to the type of
init_refcount.

bfd/ChangeLog
bfd/elf.c

index 561ff1141342c5febac4b32146e5d91fe070fe98..c4b97ee3d516d969ce2679659e646d4bbc2d648a 100644 (file)
@@ -1,3 +1,9 @@
+2002-11-20  Alexandre Oliva  <aoliva@redhat.com>
+
+       * elf.c (_bfd_elf_link_hash_table_init): Make sure
+       can_refcount is properly extended to the type of
+       init_refcount.
+
 2002-11-19  Alexandre Oliva  <aoliva@redhat.com>
 
        * elfxx-mips.c (MIPS_RELOC_RELA_P): New macro.
index c5987fe6df3eedace3bbca0e38b6d421004155e1..4ddc99dee03acea5e56ab64225125569c1ac44cb 100644 (file)
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -1503,7 +1503,10 @@ _bfd_elf_link_hash_table_init (table, abfd, newfunc)
 
   table->dynamic_sections_created = false;
   table->dynobj = NULL;
-  table->init_refcount = get_elf_backend_data (abfd)->can_refcount - 1;
+  /* Make sure can_refcount is extended to the width and signedness of
+     init_refcount before we subtract one from it.  */
+  table->init_refcount = get_elf_backend_data (abfd)->can_refcount;
+  --table->init_refcount;
   /* The first dynamic symbol is a dummy.  */
   table->dynsymcount = 1;
   table->dynstr = NULL;