From 771e446b94abe4b0e9285ee22141d5ee2a6b08e7 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Mon, 1 Dec 2003 18:46:21 +0000 Subject: [PATCH] Set page_size to 1 instead of 0 in the case file alignment value is zero. --- bfd/ChangeLog | 5 +++++ bfd/coffcode.h | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 7d33bd8c66..b1caa54ffe 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2003-12-01 Dmitry Semyonov + + * 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 * coff-rs6000.c: Remove ARGSUSED and VARARGS. diff --git a/bfd/coffcode.h b/bfd/coffcode.h index e2c27f051a..ccac05bcae 100644 --- a/bfd/coffcode.h +++ b/bfd/coffcode.h @@ -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; -- 2.34.1