Backport commit 6fde04116b4b to stop objcopy from crashing when copying non-PE binaries into a PE output.

Resolves: RHEL-48882
This commit is contained in:
Nick Clifton 2024-07-26 12:49:16 +01:00
parent f99cca1db7
commit 74fb4dd099
2 changed files with 14 additions and 1 deletions

View File

@ -252,3 +252,13 @@ diff -rup binutils.orig/binutils/testsuite/binutils-all/objcopy.exp binutils-2.3
+#...
+.* Align: 512.*
+#pass
--- binutils.orig/binutils/objcopy.c 2024-07-25 15:30:49.380323472 +0100
+++ binutils-2.35.2/binutils/objcopy.c 2024-07-25 15:33:35.779466989 +0100
@@ -4147,6 +4147,7 @@ setup_section (bfd *ibfd, sec_ptr isecti
if (p != NULL)
alignment = p->alignment;
else if (pe_section_alignment != (bfd_vma) -1
+ && bfd_get_flavour (ibfd) == bfd_target_coff_flavour
&& bfd_get_flavour (obfd) == bfd_target_coff_flavour)
{
alignment = power_of_two (pe_section_alignment);

View File

@ -2,7 +2,7 @@
Summary: A GNU collection of binary utilities
Name: binutils%{?_with_debug:-debug}
Version: 2.35.2
Release: 51%{?dist}
Release: 52%{?dist}
License: GPLv3+
URL: https://sourceware.org/binutils
@ -1305,6 +1305,9 @@ exit 0
#----------------------------------------------------------------------------
%changelog
* Thu Jul 25 2024 Nick Clifton <nickc@redhat.com> - 2.35.2-52
- Backport commit 6fde04116b4b to stop objcopy from crashing when copying non-PE binaries into a PE output. (RHEL-48882)
* Thu Jul 25 2024 Nick Clifton <nickc@redhat.com> - 2.35.2-51
- Backport commit 88141209e25ce19473ec07d7aac09cc68f06a630 to fix stripping lld linked binaries. (RHEL-50536)