From 8cbdd69541381f64fb8dbe46b495dfa11f3ae32c Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Fri, 10 Nov 2023 13:55:33 +0000 Subject: [PATCH] Make the GOLD linker ignore the "-z pack-relative-relocs" option. Resolves: #2248936 --- binutils-gold-pack-relative-relocs.patch | 27 ++++++++++++++++++++++++ binutils.spec | 9 +++++++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 binutils-gold-pack-relative-relocs.patch diff --git a/binutils-gold-pack-relative-relocs.patch b/binutils-gold-pack-relative-relocs.patch new file mode 100644 index 0000000..faa87fa --- /dev/null +++ b/binutils-gold-pack-relative-relocs.patch @@ -0,0 +1,27 @@ +diff --git a/gold/options.cc b/gold/options.cc +index c9834b66159..91d7802fffe 100644 +--- a/gold/options.cc ++++ b/gold/options.cc +@@ -989,7 +989,7 @@ parse_short_option(int argc, const char** argv, int pos_in_argv_i, + } + + // If we're a -z option, we need to parse our argument as a +- // long-option, e.g. "-z stacksize=8192". ++ // long-option, e.g. "-z stack-size=8192". + if (retval == &dash_z) + { + int dummy_i = 0; +diff --git a/gold/options.h b/gold/options.h +index 46f658f23ea..d16e38066da 100644 +--- a/gold/options.h ++++ b/gold/options.h +@@ -1110,6 +1110,9 @@ class General_options + N_("Generate package metadata note"), + N_("[=JSON]")); + ++ DEFINE_bool_ignore(pack_relative_relocs, options::DASH_Z, '\0', ++ N_("Ignored"), N_("Ignored")); ++ + DEFINE_bool(pie, options::ONE_DASH, '\0', false, + N_("Create a position independent executable"), + N_("Do not create a position independent executable")); diff --git a/binutils.spec b/binutils.spec index 36a86fd..c323e32 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.41 -Release: 12%{?dist} +Release: 13%{?dist} License: GPL-3.0-or-later AND (GPL-3.0-or-later WITH Bison-exception-2.2) AND (LGPL-2.0-or-later WITH GCC-exception-2.0) AND BSD-3-Clause AND GFDL-1.3-or-later AND GPL-2.0-or-later LGPL-2.1-or-later AND LGPL-2.0-or-later URL: https://sourceware.org/binutils @@ -286,6 +286,10 @@ Patch23: binutils-big-merge.patch # Lifetime: Fixed in 2.42 Patch24: binutils-aarch64-big-bti-programs.patch +# Purpose: Make the GOLD linker ignore the "-z pack-relative-relocs" command line option. +# Lifetime: Fixed in 2.42 (maybe) +Patch25: binutils-gold-pack-relative-relocs.patch + #---------------------------------------------------------------------------- Provides: bundled(libiberty) @@ -1291,6 +1295,9 @@ exit 0 #---------------------------------------------------------------------------- %changelog +* Fri Nov 10 2023 Nick Clifton - 2.41-13 +- Make the GOLD linker ignore the "-z pack-relative-relocs" option. (#2248936) + * Tue Nov 07 2023 Nick Clifton - 2.41-12 - Fix the bfd linker's generation of call stubs for large AArch64 binaries with BTI enabled. (#2241902)