From a4a027b7f43b1d9e62a6a540cd7857a334d37b12 Mon Sep 17 00:00:00 2001 From: Kai Tietz Date: Wed, 20 Aug 2014 17:39:21 +0200 Subject: [PATCH] Fix file-alignment for objcopy for pe-coff 2014-08-22 Kai Tietz PR binutils/11822 * coffcode.h (coff_compute_section_file_positions): Keep FileAlignment valid as set. --- bfd/ChangeLog | 6 ++++++ bfd/coffcode.h | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 6c98ed34d57..04b44653f29 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2014-08-22 Kai Tietz + + PR binutils/11822 + * coffcode.h (coff_compute_section_file_positions): Keep + FileAlignment valid as set. + 2014-08-22 Alan Modra * elf-eh-frame.c (struct cie): Delete "output_sec" field. diff --git a/bfd/coffcode.h b/bfd/coffcode.h index 89ca2346612..6678b88bbd5 100644 --- a/bfd/coffcode.h +++ b/bfd/coffcode.h @@ -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; -- 2.30.2