(init_os): Make sure that the newly allocated userdata structure is zeroed out.
authorNick Clifton <nickc@redhat.com>
Wed, 21 Jul 2004 15:05:46 +0000 (15:05 +0000)
committerNick Clifton <nickc@redhat.com>
Wed, 21 Jul 2004 15:05:46 +0000 (15:05 +0000)
ld/ChangeLog
ld/ldlang.c

index 03dd40fd49415f9c6f41d0481449f0b7cd181609..b34292d05aec5a3a7d2ab57b5c426614aee5c7b8 100644 (file)
@@ -1,3 +1,8 @@
+2004-07-21  Nick Clifton  <nickc@redhat.com>
+
+       * ldlang.c (init_os): Make sure that the newly allocated userdata
+       structure is zeroed out.
+
 2004-07-19  H.J. Lu  <hongjiu.lu@intel.com>
 
        * NEWS: Mention the new --add-needed/--no-add-needed and
index c5cfd5c45a26b40432a11db5f4ac9059424f93b6..9ea28696a764858fd2ad1ac9a29fd53c5cf9d156 100644 (file)
@@ -785,9 +785,10 @@ sort_def_symbol (hash_entry, info)
        }
       else if  (!ud->map_symbol_def_tail)
        ud->map_symbol_def_tail = &ud->map_symbol_def_head;
+      
       def = obstack_alloc (&map_obstack, sizeof *def);
       def->entry = hash_entry;
-      *ud->map_symbol_def_tail = def;
+      *(ud->map_symbol_def_tail) = def;
       ud->map_symbol_def_tail = &def->next;
     }
   return TRUE;
@@ -807,6 +808,7 @@ init_os (lang_output_section_statement_type *s)
     einfo (_("%P%F: Illegal use of `%s' section\n"), DISCARD_SECTION_NAME);
 
   new = stat_alloc (SECTION_USERDATA_SIZE);
+  memset (new, 0, SECTION_USERDATA_SIZE);
 
   s->bfd_section = bfd_get_section_by_name (output_bfd, s->name);
   if (s->bfd_section == NULL)