Set page_size to 1 instead of 0 in the case file alignment value is zero.
authorNick Clifton <nickc@redhat.com>
Mon, 1 Dec 2003 18:46:21 +0000 (18:46 +0000)
committerNick Clifton <nickc@redhat.com>
Mon, 1 Dec 2003 18:46:21 +0000 (18:46 +0000)
bfd/ChangeLog
bfd/coffcode.h

index 7d33bd8c66db105580b1ff67b022e4e09a4e0a33..b1caa54ffe18547846a22c2a319157a4ecdbd5fc 100644 (file)
@@ -1,3 +1,8 @@
+2003-12-01  Dmitry Semyonov  <Dmitry.Semyonov@oktet.ru>
+
+       * coffcode.h (coff_compute_section_file_positions): Set page_size
+       to 1 instead of 0 in the case file alignment value is zero.
+
 2003-12-01  Kazu Hirata  <kazu@cs.umass.edu>
 
        * coff-rs6000.c: Remove ARGSUSED and VARARGS.
index e2c27f051a5ae3d1542d5441e5d3a764585a80a6..ccac05bcaec0bf614f28d386e6b90134ce67cdb2 100644 (file)
@@ -3014,6 +3014,11 @@ coff_compute_section_file_positions (abfd)
   if (coff_data (abfd)->link_info)
     {
       page_size = pe_data (abfd)->pe_opthdr.FileAlignment;
+
+      /* If no file alignment has been set, default to one.
+        This repairs 'ld -r' for arm-wince-pe target.  */
+      if (page_size == 0)
+        page_size = 1;
     }
   else
     page_size = PE_DEF_FILE_ALIGNMENT;