diff --git a/binutils-relro-padding.patch b/binutils-relro-padding.patch new file mode 100644 index 0000000..73d3615 --- /dev/null +++ b/binutils-relro-padding.patch @@ -0,0 +1,15 @@ +--- binutils.orig/bfd/elf.c 2024-07-25 09:01:36.091804849 +0100 ++++ binutils-2.35.2/bfd/elf.c 2024-07-25 09:02:22.645006725 +0100 +@@ -2759,6 +2759,12 @@ static const struct bfd_elf_special_sect + { STRING_COMMA_LEN (".rodata"), -2, SHT_PROGBITS, SHF_ALLOC }, + { STRING_COMMA_LEN (".rodata1"), 0, SHT_PROGBITS, SHF_ALLOC }, + { STRING_COMMA_LEN (".rela"), -1, SHT_RELA, 0 }, ++ /* .relro_padding is generated by lld. It should not be confused with a ++ reloc containing section, because otherwise elf_fake_sections() will ++ set the entsize to 8, which may not be an actual multiple of the ++ section's size. ++ Note - this entry must appear before the ".rel" entry below. */ ++ { STRING_COMMA_LEN (".relro_padding"), 0, SHT_NOBITS, SHF_ALLOC | SHF_WRITE }, + { STRING_COMMA_LEN (".rel"), -1, SHT_REL, 0 }, + { NULL, 0, 0, 0, 0 } + }; diff --git a/binutils.spec b/binutils.spec index 9da3c8f..1729f97 100644 --- a/binutils.spec +++ b/binutils.spec @@ -2,7 +2,7 @@ Summary: A GNU collection of binary utilities Name: binutils%{?_with_debug:-debug} Version: 2.35.2 -Release: 50%{?dist} +Release: 51%{?dist} License: GPLv3+ URL: https://sourceware.org/binutils @@ -461,6 +461,10 @@ Patch70: binutils-prune-lto-messages.patch # Lifetime: Fixed in 2.38 Patch71: binutils-relro.patch +# Purpose: Stop the BFD library from treating the .relro-padding section as a REL section. +# Lifetime: Fixed in 2.44 +Patch72: binutils-relro-padding.patch + #---------------------------------------------------------------------------- Provides: bundled(libiberty) @@ -1301,6 +1305,9 @@ exit 0 #---------------------------------------------------------------------------- %changelog +* Thu Jul 25 2024 Nick Clifton - 2.35.2-51 +- Backport commit 88141209e25ce19473ec07d7aac09cc68f06a630 to fix stripping lld linked binaries. (RHEL-50536) + * Fri Jul 12 2024 Nick Clifton - 2.35.2-50 - Additional patch (commit 31b4d3a16f200bf04db8439a63b72bba7af4e1be). (RHEL-45873)