From: Alexandre Oliva Date: Wed, 20 Nov 2002 18:17:04 +0000 (+0000) Subject: * elf.c (_bfd_elf_link_hash_table_init): Make sure X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=963f13ecfe413460bc1d8b18847eb42cd2e8b0f5;p=binutils-gdb.git * elf.c (_bfd_elf_link_hash_table_init): Make sure can_refcount is properly extended to the type of init_refcount. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 561ff114134..c4b97ee3d51 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2002-11-20 Alexandre Oliva + + * 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 * elfxx-mips.c (MIPS_RELOC_RELA_P): New macro. diff --git a/bfd/elf.c b/bfd/elf.c index c5987fe6df3..4ddc99dee03 100644 --- 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;