diff options
| author | WANG Xuerui <git@xen0n.name> | 2025-10-06 18:09:14 +0800 |
|---|---|---|
| committer | abner chenc <chenguoqi@loongson.cn> | 2025-11-20 19:04:50 -0800 |
| commit | 4b0e3cc1d63a00ee184ea1f6b17e79808e3d9fdc (patch) | |
| tree | a39935c924fff622dc112d627030d86a5cc1fb1a /src/cmd/internal/obj | |
| parent | cdba82c7d6fce54b212872ae45d04c3911b11014 (diff) | |
| download | go-4b0e3cc1d63a00ee184ea1f6b17e79808e3d9fdc.tar.xz | |
cmd/link: support loading R_LARCH_PCREL20_S2 and R_LARCH_CALL36 relocs
Host libgcc.a (among other libraries) on loong64 systems may contain
such relocs if built with the "medium" code model and/or linker
relaxation, which is increasingly the case. Make the internal linker
aware of these for cgo interopability going forward.
While at it, fix some of the comments for the loong64-specific
RelocTypes.
Fixes #75562
Change-Id: I0810969dcd229c5131ef06b0f70f51d81a3be4cd
Reviewed-on: https://go-review.googlesource.com/c/go/+/709717
Reviewed-by: abner chenc <chenguoqi@loongson.cn>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
Reviewed-by: Meidan Li <limeidan@loongson.cn>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Diffstat (limited to 'src/cmd/internal/obj')
| -rw-r--r-- | src/cmd/internal/obj/fips140.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/cmd/internal/obj/fips140.go b/src/cmd/internal/obj/fips140.go index da18b64178..8f5b0c4b82 100644 --- a/src/cmd/internal/obj/fips140.go +++ b/src/cmd/internal/obj/fips140.go @@ -354,8 +354,10 @@ func (s *LSym) checkFIPSReloc(ctxt *Link, rel Reloc) { objabi.R_CALLLOONG64, objabi.R_CALLPOWER, 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_ADDR_LO, // used with PC-relative load + objabi.R_LOONG64_ADDR_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, objabi.R_LOONG64_TLS_LE_LO, objabi.R_LOONG64_TLS_IE_HI, |
