summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2008-12-23 10:59:56 +0000
committerNick Clifton <nickc@redhat.com>2008-12-23 10:59:56 +0000
commit1db752a0e1587b665027f6b8fc36a8e33a53c06b (patch)
tree8ca14c18b9d9ec3a8097dfc2883f63b6804bbe4d
parent0f6edcac1e500fa9a6f77f4287f94c8ff75f3716 (diff)
downloadbinutils-redhat-1db752a0e1587b665027f6b8fc36a8e33a53c06b.tar.gz
* coffcode.h (coff_write_object_contents): Always initialise
section.s_page. * ti.h (COFF_ADJUST_SCNHDR_OUT_PRE): Define.
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/coffcode.h2
-rw-r--r--include/coff/ChangeLog4
-rw-r--r--include/coff/ti.h9
4 files changed, 20 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 07e101768c..221c4a4c81 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2008-12-23 Johan Olmutz Nielsen <jnielsen@ddci.com>
+
+ * coffcode.h (coff_write_object_contents): Always initialise
+ section.s_page.
+
2008-12-23 Andreas Schwab <schwab@suse.de>
* elf32-m68k.c (elf_m68k_discard_copies): Use SYMBOL_CALLS_LOCAL.
diff --git a/bfd/coffcode.h b/bfd/coffcode.h
index 3b98c5dc9f..12d2ad5f2c 100644
--- a/bfd/coffcode.h
+++ b/bfd/coffcode.h
@@ -3528,6 +3528,8 @@ coff_write_object_contents (bfd * abfd)
section.s_size = current->size;
#ifdef coff_get_section_load_page
section.s_page = coff_get_section_load_page (current);
+#else
+ section.s_page = 0;
#endif
#ifdef COFF_WITH_PE
diff --git a/include/coff/ChangeLog b/include/coff/ChangeLog
index ef5852ab35..53bf7e5117 100644
--- a/include/coff/ChangeLog
+++ b/include/coff/ChangeLog
@@ -1,3 +1,7 @@
+2008-12-23 Johan Olmutz Nielsen <jnielsen@ddci.com>
+
+ * ti.h (COFF_ADJUST_SCNHDR_OUT_PRE): Define.
+
2008-06-17 Nick Clifton <nickc@redhat.com>
* ti.h (GET_SCNHDR_NLNNO): Provide an alternative version of this
diff --git a/include/coff/ti.h b/include/coff/ti.h
index 86f7a13398..e0e17293d9 100644
--- a/include/coff/ti.h
+++ b/include/coff/ti.h
@@ -321,6 +321,15 @@ struct external_scnhdr {
} \
while (0)
+/* The entire scnhdr may not be assigned.
+ Ensure that everything is initialized. */
+#define COFF_ADJUST_SCNHDR_OUT_PRE(ABFD, INT, EXT) \
+ do \
+ { \
+ memset((EXT), 0, sizeof (SCNHDR)); \
+ } \
+ while (0)
+
/* The line number and reloc overflow checking in coff_swap_scnhdr_out in
coffswap.h doesn't use PUT_X for s_nlnno and s_nreloc.
Due to different sized v0/v1/v2 section headers, we have to re-write these