Fix file-alignment for objcopy for pe-coff
authorKai Tietz <ktietz70@googlemail.com>
Wed, 20 Aug 2014 15:39:21 +0000 (17:39 +0200)
committerKai Tietz <ktietz70@googlemail.com>
Fri, 22 Aug 2014 09:26:26 +0000 (11:26 +0200)
2014-08-22  Kai Tietz  <ktietz@redhat.com>

PR binutils/11822
* coffcode.h (coff_compute_section_file_positions): Keep
FileAlignment valid as set.

bfd/ChangeLog
bfd/coffcode.h

index 6c98ed34d5737e2fd05220520e51251eb4d95fe2..04b44653f29c61785e0506f9aa334f07b951f227 100644 (file)
@@ -1,3 +1,9 @@
+2014-08-22  Kai Tietz  <ktietz@redhat.com>
+
+       PR binutils/11822
+       * coffcode.h (coff_compute_section_file_positions): Keep
+       FileAlignment valid as set.
+
 2014-08-22  Alan Modra  <amodra@gmail.com>
 
        * elf-eh-frame.c (struct cie): Delete "output_sec" field.
index 89ca23466126878fb3388628bf04320d2cc2b1c3..6678b88bbd58781c70f87dde955faa821031dd66 100644 (file)
@@ -3134,7 +3134,8 @@ coff_compute_section_file_positions (bfd * abfd)
 #ifdef COFF_IMAGE_WITH_PE
   int page_size;
 
-  if (coff_data (abfd)->link_info)
+  if (coff_data (abfd)->link_info
+      || (pe_data (abfd) && pe_data (abfd)->pe_opthdr.FileAlignment))
     {
       page_size = pe_data (abfd)->pe_opthdr.FileAlignment;