aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/internal/obj
diff options
context:
space:
mode:
authorGuoqi Chen <chenguoqi@loongson.cn>2026-03-12 15:34:02 +0800
committerabner chenc <chenguoqi@loongson.cn>2026-03-18 18:08:22 -0700
commit9def4acb06bf9167441caa8af37e27b3cdbf8cf0 (patch)
tree00dff920091176d8594de42d8f98f2c4ff3881b7 /src/cmd/internal/obj
parent6bdfdb5f51951584732e6a95a7ee8a5ba5e8cb93 (diff)
downloadgo-9def4acb06bf9167441caa8af37e27b3cdbf8cf0.tar.xz
cmd/link: support loading R_LARCH_GOT64_PC_{LO12, HI20} relocs on loong64
On loong64, such relocations are increasingly common when built using an "extreme" code model. To ensure future interoperability with cgo, the linker needs to be made aware of these relocations. Ref: https://github.com/loongson/la-abi-specs/blob/release/laelf.adoc Fixes #78047. Change-Id: Ibca205ab837279c69fb243a8e8519c952e11c99e Reviewed-on: https://go-review.googlesource.com/c/go/+/753521 Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Meidan Li <limeidan@loongson.cn> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Carlos Amedee <carlos@golang.org>
Diffstat (limited to 'src/cmd/internal/obj')
-rw-r--r--src/cmd/internal/obj/fips140.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cmd/internal/obj/fips140.go b/src/cmd/internal/obj/fips140.go
index b888396b1f..0e4f2a47a3 100644
--- a/src/cmd/internal/obj/fips140.go
+++ b/src/cmd/internal/obj/fips140.go
@@ -356,6 +356,8 @@ func (s *LSym) checkFIPSReloc(ctxt *Link, rel Reloc) {
objabi.R_GOTPCREL,
objabi.R_LOONG64_ADDR_LO, // used with PC-relative load
objabi.R_LOONG64_ADDR_HI, // used with PC-relative load
+ objabi.R_LOONG64_ADDR64_LO, // used with PC-relative load
+ objabi.R_LOONG64_ADDR64_HI, // used with PC-relative load
objabi.R_LOONG64_ADDR_PCREL20_S2, // used with PC-relative load
objabi.R_LOONG64_CALL36,
objabi.R_LOONG64_TLS_LE_HI,
@@ -364,6 +366,8 @@ func (s *LSym) checkFIPSReloc(ctxt *Link, rel Reloc) {
objabi.R_LOONG64_TLS_IE_LO,
objabi.R_LOONG64_GOT_HI,
objabi.R_LOONG64_GOT_LO,
+ objabi.R_LOONG64_GOT64_HI,
+ objabi.R_LOONG64_GOT64_LO,
objabi.R_JMP16LOONG64,
objabi.R_JMP21LOONG64,
objabi.R_PCREL,