commit: 59296ad3d53739d80c9bb80a394bf688b8b8482f
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 5 11:22:24 2025 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Sat Apr 5 11:22:24 2025 +0000
URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=59296ad3
sys-devel/binutils-2.44: add solaris gas write patch from OI
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>
sys-devel/binutils/binutils-2.44.ebuild | 1 +
.../files/binutils-2.44-solaris-gas-write.patch | 27 ++++++++++++++++++++++
2 files changed, 28 insertions(+)
diff --git a/sys-devel/binutils/binutils-2.44.ebuild
b/sys-devel/binutils/binutils-2.44.ebuild
index 5fc13a3fa6..689da3ad2f 100644
--- a/sys-devel/binutils/binutils-2.44.ebuild
+++ b/sys-devel/binutils/binutils-2.44.ebuild
@@ -84,6 +84,7 @@ RESTRICT="!test? ( test )"
PATCHES=(
"${FILESDIR}"/${PN}-2.22-solaris-anonymous-version-script-fix.patch
+ "${FILESDIR}"/${PN}-2.44-solaris-gas-write.patch
)
MY_BUILDDIR=${WORKDIR}/build
diff --git a/sys-devel/binutils/files/binutils-2.44-solaris-gas-write.patch
b/sys-devel/binutils/files/binutils-2.44-solaris-gas-write.patch
new file mode 100644
index 0000000000..7abb37ca85
--- /dev/null
+++ b/sys-devel/binutils/files/binutils-2.44-solaris-gas-write.patch
@@ -0,0 +1,27 @@
+https://github.com/OpenIndiana/oi-userland/blob/oi/hipster/components/developer/binutils/patches/02-gas.write.c.patch
+
+--- binutils-2.44/gas/write.c.orig
++++ binutils-2.44/gas/write.c
+@@ -833,6 +833,22 @@
+ sym = newsym;
+ }
+
++ /* Also convert fx_subsy if present */
++ if (fixp->fx_subsy != NULL)
++ {
++ symbolS *sub_sym = fixp->fx_subsy;
++ while (symbol_equated_reloc_p (sub_sym)
++ || S_IS_WEAKREFR (sub_sym))
++ {
++ symbolS *newsym = symbol_get_value_expression
(sub_sym)->X_add_symbol;
++ if (sub_sym == newsym)
++ break;
++ fixp->fx_offset -= symbol_get_value_expression
(sub_sym)->X_add_number;
++ fixp->fx_subsy = newsym;
++ sub_sym = newsym;
++ }
++ }
++
+ if (symbol_mri_common_p (sym))
+ {
+ fixp->fx_offset += S_GET_VALUE (sym);