diff --git a/do-not-reuse-far-trampolines.patch b/do-not-reuse-far-trampolines.patch deleted file mode 100644 index 8d8d80640da28ef78143d5801e24e78fb3581c42..0000000000000000000000000000000000000000 --- a/do-not-reuse-far-trampolines.patch +++ /dev/null @@ -1,160 +0,0 @@ -From 63dd776220bb3a443e6b5c0766a389ec33dc4b69 Mon Sep 17 00:00:00 2001 -From: "Paul E. Murphy" -Date: Wed, 16 Nov 2022 14:53:39 -0600 -Subject: [PATCH] [release-branch.go1.18] cmd/link/internal/ppc64: fix - trampoline reuse distance calculation - -If a compatible trampoline has been inserted by a previously laid -function in the same section, and is known to be sufficiently close, -it can be reused. - -When testing if the trampoline can be reused, the addend of the direct -call should be ignored. It is already encoded in the trampoline. If the -addend is non-zero, and the target sufficiently far away, and just -beyond direct call reach, this may cause the trampoline to be -incorrectly reused. - -This was observed on go1.17.13 and openshift-installer commit f3c53b382 -building in release mode with the following error: - -github.com/aliyun/alibaba-cloud-sdk-go/services/cms.(*Client).DescribeMonitoringAgentAccessKeyWithChan.func1: direct call too far: runtime.duffzero+1f0-tramp0-1 -2000078 - -Fixes #56833 - -Change-Id: I54af957302506d4e3cd5d3121542c83fe980e912 -Reviewed-on: https://go-review.googlesource.com/c/go/+/451415 -Reviewed-by: Cherry Mui -Run-TryBot: Paul Murphy -TryBot-Result: Gopher Robot -Reviewed-by: Lynn Boger -Reviewed-by: Than McIntosh -Reviewed-on: https://go-review.googlesource.com/c/go/+/451916 -Reviewed-by: Joedian Reid ---- - .../testdata/script/trampoline_reuse_test.txt | 100 ++++++++++++++++++ - src/cmd/link/internal/ppc64/asm.go | 5 +- - 2 files changed, 103 insertions(+), 2 deletions(-) - create mode 100644 src/cmd/go/testdata/script/trampoline_reuse_test.txt - -diff --git a/src/cmd/go/testdata/script/trampoline_reuse_test.txt b/src/cmd/go/testdata/script/trampoline_reuse_test.txt -new file mode 100644 -index 0000000000000..bca897c16d054 ---- /dev/null -+++ b/src/cmd/go/testdata/script/trampoline_reuse_test.txt -@@ -0,0 +1,100 @@ -+# Verify PPC64 does not reuse a trampoline which is too far away. -+# This tests an edge case where the direct call relocation addend should -+# be ignored when computing the distance from the direct call to the -+# already placed trampoline -+[short] skip -+[!ppc64] [!ppc64le] skip -+[aix] skip -+ -+# Note, this program does not run. Presumably, 'DWORD $0' is simpler to -+# assembly 2^26 or so times. -+# -+# We build something which should be laid out as such: -+# -+# bar.Bar -+# main.Func1 -+# bar.Bar+400-tramp0 -+# main.BigAsm -+# main.Func2 -+# bar.Bar+400-tramp1 -+# -+# bar.Bar needs to be placed far enough away to generate relocations -+# from main package calls. and main.Func1 and main.Func2 are placed -+# a bit more than the direct call limit apart, but not more than 0x400 -+# bytes beyond it (to verify the reloc calc). -+ -+go build -+ -+-- go.mod -- -+ -+module foo -+ -+go 1.19 -+ -+-- main.go -- -+ -+package main -+ -+import "foo/bar" -+ -+func Func1() -+ -+func main() { -+ Func1() -+ bar.Bar2() -+} -+ -+-- foo.s -- -+ -+TEXT main·Func1(SB),0,$0-0 -+ CALL bar·Bar+0x400(SB) -+ CALL main·BigAsm(SB) -+// A trampoline will be placed here to bar.Bar -+ -+// This creates a gap sufficiently large to prevent trampoline reuse -+#define NOP64 DWORD $0; DWORD $0; DWORD $0; DWORD $0; DWORD $0; DWORD $0; DWORD $0; DWORD $0; -+#define NOP256 NOP64 NOP64 NOP64 NOP64 -+#define NOP2S10 NOP256 NOP256 NOP256 NOP256 -+#define NOP2S12 NOP2S10 NOP2S10 NOP2S10 NOP2S10 -+#define NOP2S14 NOP2S12 NOP2S12 NOP2S12 NOP2S12 -+#define NOP2S16 NOP2S14 NOP2S14 NOP2S14 NOP2S14 -+#define NOP2S18 NOP2S16 NOP2S16 NOP2S16 NOP2S16 -+#define NOP2S20 NOP2S18 NOP2S18 NOP2S18 NOP2S18 -+#define NOP2S22 NOP2S20 NOP2S20 NOP2S20 NOP2S20 -+#define NOP2S24 NOP2S22 NOP2S22 NOP2S22 NOP2S22 -+#define BIGNOP NOP2S24 NOP2S24 -+TEXT main·BigAsm(SB),0,$0-0 -+ // Fill to the direct call limit so Func2 must generate a new trampoline. -+ // As the implicit trampoline above is just barely unreachable. -+ BIGNOP -+ MOVD $main·Func2(SB), R3 -+ -+TEXT main·Func2(SB),0,$0-0 -+ CALL bar·Bar+0x400(SB) -+// Another trampoline should be placed here. -+ -+-- bar/bar.s -- -+ -+#define NOP64 DWORD $0; DWORD $0; DWORD $0; DWORD $0; DWORD $0; DWORD $0; DWORD $0; DWORD $0; -+#define NOP256 NOP64 NOP64 NOP64 NOP64 -+#define NOP2S10 NOP256 NOP256 NOP256 NOP256 -+#define NOP2S12 NOP2S10 NOP2S10 NOP2S10 NOP2S10 -+#define NOP2S14 NOP2S12 NOP2S12 NOP2S12 NOP2S12 -+#define NOP2S16 NOP2S14 NOP2S14 NOP2S14 NOP2S14 -+#define NOP2S18 NOP2S16 NOP2S16 NOP2S16 NOP2S16 -+#define NOP2S20 NOP2S18 NOP2S18 NOP2S18 NOP2S18 -+#define NOP2S22 NOP2S20 NOP2S20 NOP2S20 NOP2S20 -+#define NOP2S24 NOP2S22 NOP2S22 NOP2S22 NOP2S22 -+#define BIGNOP NOP2S24 NOP2S24 NOP2S10 -+// A very big not very interesting function. -+TEXT bar·Bar(SB),0,$0-0 -+ BIGNOP -+ -+-- bar/bar.go -- -+ -+package bar -+ -+func Bar() -+ -+func Bar2() { -+} -diff --git a/src/cmd/link/internal/ppc64/asm.go b/src/cmd/link/internal/ppc64/asm.go -index 73c2718a3369f..879adaa965050 100644 ---- a/src/cmd/link/internal/ppc64/asm.go -+++ b/src/cmd/link/internal/ppc64/asm.go -@@ -809,8 +809,9 @@ func trampoline(ctxt *ld.Link, ldr *loader.Loader, ri int, rs, s loader.Sym) { - if ldr.SymValue(tramp) == 0 { - break - } -- -- t = ldr.SymValue(tramp) + r.Add() - (ldr.SymValue(s) + int64(r.Off())) -+ // Note, the trampoline is always called directly. The addend of the original relocation is accounted for in the -+ // trampoline itself. -+ t = ldr.SymValue(tramp) - (ldr.SymValue(s) + int64(r.Off())) - - // With internal linking, the trampoline can be used if it is not too far. - // With external linking, the trampoline must be in this section for it to be reused. diff --git a/download b/download index eced9bb0c95bef40cab2ebd980d2cc9638d4294a..d3db847d896b23ee0d6adf192d4b41c95fcb357e 100644 --- a/download +++ b/download @@ -1 +1 @@ -9f417f53d8e1991cad5e7dc9152b6c6a go1.18.9-1-openssl-fips.tar.gz +99c5004e659dfac9c6cecc7269406c7d go1.18.10-1-openssl-fips.tar.gz diff --git a/golang.spec b/golang.spec index 426f6827ded795be83502976b692ce71b9a269c1..29ae98818e4d5b7188fc0a7132aea1f464d6ec4d 100644 --- a/golang.spec +++ b/golang.spec @@ -99,9 +99,9 @@ %endif %global go_api 1.18 -%global go_version 1.18.9 +%global go_version 1.18.10 %global pkg_release 1 -%global anolis_release .0.2 +%global anolis_release .0.1 Name: golang Version: %{go_version} @@ -153,7 +153,6 @@ Patch223: remove_ed25519vectors_test.patch Patch227: cmd-link-use-correct-path-for-dynamic-loader-on-ppc6.patch -Patch228: do-not-reuse-far-trampolines.patch Patch229: big-endian.patch # Having documentation separate was broken @@ -250,7 +249,6 @@ Requires: %{name} = %{version}-%{release} %patch223 -p1 %patch226 -p1 %patch227 -p1 -%patch228 -p1 %patch229 -p1 ## Apply loongarch64 patches @@ -535,7 +533,8 @@ cd .. %endif %changelog -* Thu Mar 16 2023 zhaoxiaolin - 1.18.9-1.0.2 +* Fri Apr 07 2023 zhaoxiaolin - 1.18.10-1.0.1 +- Add loongarch64 base support (chenguoqi@loongson.cn) - runtime: implement undefined reference funcs & remove atomic prefix - support --buildmode=shared for loong64 - support --buildmode=plugin for loong64 @@ -552,8 +551,10 @@ cd .. - cmd/internal/obj/loong64: add support for movgr2cf and movcf2gr instructions - runtime: save and restore fcc registers in async preempt on loong64 -* Sun Jan 29 2023 chenguoqi - 1.18.9-1.0.1 -- Add loongarch64 base support. +* Thu Mar 02 2023 Alejandro Sáez - 1.18.10-1 +- Update to Go 1.18.10 +- Remove ./do-not-reuse-far-trampolines.patch +- Resolves: rhbz#2174417 * Thu Dec 22 2022 Alejandro Sáez - 1.18.9-1 - Update to Go 1.18.9