aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2004-07-21 15:05:46 +0000
committerNick Clifton <nickc@redhat.com>2004-07-21 15:05:46 +0000
commit76d7af2d04354fe7225eba82b02a16bfb5772e80 (patch)
tree3ea129c9fb2bece36ad5d93fd524a260b7b82e25 /ld
parenta53c66de31b87c66e2fc17afb3558983a5d80bf9 (diff)
downloadgdb-76d7af2d04354fe7225eba82b02a16bfb5772e80.zip
gdb-76d7af2d04354fe7225eba82b02a16bfb5772e80.tar.gz
gdb-76d7af2d04354fe7225eba82b02a16bfb5772e80.tar.bz2
(init_os): Make sure that the newly allocated userdata structure is zeroed out.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog5
-rw-r--r--ld/ldlang.c4
2 files changed, 8 insertions, 1 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 03dd40f..b34292d 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -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
diff --git a/ld/ldlang.c b/ld/ldlang.c
index c5cfd5c..9ea2869 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -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)