From: Nick Clifton Date: Mon, 1 Dec 2003 18:46:21 +0000 (+0000) Subject: Set page_size to 1 instead of 0 in the case file alignment value is zero. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=771e446b94abe4b0e9285ee22141d5ee2a6b08e7;p=binutils-gdb.git Set page_size to 1 instead of 0 in the case file alignment value is zero. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 7d33bd8c66d..b1caa54ffe1 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 e2c27f051a5..ccac05bcaec 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;