aboutsummaryrefslogtreecommitdiff
path: root/src/debug
diff options
context:
space:
mode:
authorGuoqi Chen <chenguoqi@loongson.cn>2023-10-24 16:24:39 +0800
committerCherry Mui <cherryyz@google.com>2023-11-02 19:46:03 +0000
commit39d3c4ad35984b470b2928a37ea4a7e721b1225a (patch)
tree9b517ba798f8b80e14251d2a8948f7407d9ff58c /src/debug
parent925a4d93dcc958ee9250bcc213baa0fc7bd892ae (diff)
downloadgo-39d3c4ad35984b470b2928a37ea4a7e721b1225a.tar.gz
go-39d3c4ad35984b470b2928a37ea4a7e721b1225a.zip
debug/elf,cmd/link: add additional relocations for loong64
The Linker Relaxation feature on Loong64 is already supported in binutils 2.41. The intermediate code generated after enabling this feature introduces three reloc types R_LARCH_B26, R_LARCH_ADD32 and R_LARCH_SUB32. The other relocation types are not currently used when running all.bash, but in order to avoid the host tool chain making the decision to use it we don't have to catch it every time. The LoongArch ABI at here: https://github.com/loongson/la-abi-specs/blob/release/la-abi.adoc Corresponding binutils implementation: https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=be1ebb6710a8f707bd4b0eecbd00f4f4964050e5 https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=1b6fccd28db14fffe75ff6755307047ef932c81e Fixes #63725 Change-Id: I891115cfdbcf785ab494c881d5f9d1bf8748da8b Reviewed-on: https://go-review.googlesource.com/c/go/+/537615 Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Meidan Li <limeidan@loongson.cn> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/debug')
-rw-r--r--src/debug/elf/elf.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/debug/elf/elf.go b/src/debug/elf/elf.go
index 35b0e3bc83..534cfa9127 100644
--- a/src/debug/elf/elf.go
+++ b/src/debug/elf/elf.go
@@ -2368,6 +2368,15 @@ const (
R_LARCH_TLS_GD_HI20 R_LARCH = 98
R_LARCH_32_PCREL R_LARCH = 99
R_LARCH_RELAX R_LARCH = 100
+ R_LARCH_DELETE R_LARCH = 101
+ R_LARCH_ALIGN R_LARCH = 102
+ R_LARCH_PCREL20_S2 R_LARCH = 103
+ R_LARCH_CFA R_LARCH = 104
+ R_LARCH_ADD6 R_LARCH = 105
+ R_LARCH_SUB6 R_LARCH = 106
+ R_LARCH_ADD_ULEB128 R_LARCH = 107
+ R_LARCH_SUB_ULEB128 R_LARCH = 108
+ R_LARCH_64_PCREL R_LARCH = 109
)
var rlarchStrings = []intName{
@@ -2460,6 +2469,15 @@ var rlarchStrings = []intName{
{98, "R_LARCH_TLS_GD_HI20"},
{99, "R_LARCH_32_PCREL"},
{100, "R_LARCH_RELAX"},
+ {101, "R_LARCH_DELETE"},
+ {102, "R_LARCH_ALIGN"},
+ {103, "R_LARCH_PCREL20_S2"},
+ {104, "R_LARCH_CFA"},
+ {105, "R_LARCH_ADD6"},
+ {106, "R_LARCH_SUB6"},
+ {107, "R_LARCH_ADD_ULEB128"},
+ {108, "R_LARCH_SUB_ULEB128"},
+ {109, "R_LARCH_64_PCREL"},
}
func (i R_LARCH) String() string { return stringName(uint32(i), rlarchStrings, false) }