(_bfd_dwarf2_find_nearest_line): If address length is zero, set it to 8 for
[deliverable/binutils-gdb.git] / bfd / cofflink.c
index 1eac3c58ce800b28c8fb21f5e62f5c8724609480..eb9388fc71ed5d4ad35adc687968317573715ce7 100644 (file)
@@ -342,12 +342,10 @@ coff_link_add_symbols (abfd, info)
   /* We keep a list of the linker hash table entries that correspond
      to particular symbols.  */
   amt = symcount * sizeof (struct coff_link_hash_entry *);
-  sym_hash = (struct coff_link_hash_entry **) bfd_alloc (abfd, amt);
+  sym_hash = (struct coff_link_hash_entry **) bfd_zalloc (abfd, amt);
   if (sym_hash == NULL && symcount != 0)
     goto error_return;
   obj_coff_sym_hashes (abfd) = sym_hash;
-  memset (sym_hash, 0,
-         (size_t) symcount * sizeof (struct coff_link_hash_entry *));
 
   symesz = bfd_coff_symesz (abfd);
   BFD_ASSERT (symesz == bfd_coff_auxesz (abfd));
@@ -759,6 +757,10 @@ _bfd_coff_final_link (abfd, info)
          o->flags |= SEC_RELOC;
          o->rel_filepos = rel_filepos;
          rel_filepos += o->reloc_count * relsz;
+         /* In PE COFF, if there are at least 0xffff relocations an
+            extra relocation will be written out to encode the count.  */
+         if (obj_pe (abfd) && o->reloc_count >= 0xffff)
+           rel_filepos += relsz;
        }
 
       if (bfd_coff_long_section_names (abfd)
This page took 0.024767 seconds and 4 git commands to generate.