* coffcode.h (coff_write_object_contents): Always initialise
authorNick Clifton <nickc@redhat.com>
Tue, 23 Dec 2008 10:59:56 +0000 (10:59 +0000)
committerNick Clifton <nickc@redhat.com>
Tue, 23 Dec 2008 10:59:56 +0000 (10:59 +0000)
            section.s_page.

            * ti.h (COFF_ADJUST_SCNHDR_OUT_PRE): Define.

bfd/ChangeLog
bfd/coffcode.h
include/coff/ChangeLog
include/coff/ti.h

index 07e101768c4822fce5bfaac36d2c0729d8e97965..221c4a4c81106c4f5caad5ed2f1241e2d613f459 100644 (file)
@@ -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.
index 3b98c5dc9fb11150cdc4a6d409668f93978b0630..12d2ad5f2cf040fb32060212ea159adc37f163ca 100644 (file)
@@ -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
index ef5852ab357f89d2b72fb72e1dcdcba91feaa194..53bf7e51178cd44539e21af39efaa884cea2fbea 100644 (file)
@@ -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
index 86f7a13398790fc345a175501f2fe11e5fdd3dc0..e0e17293d9309da2da3b3b98245c6bcbe0b70eef 100644 (file)
@@ -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