aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/internal/obj
diff options
context:
space:
mode:
authorlimeidan <limeidan@loongson.cn>2024-01-12 09:58:35 +0800
committerGopher Robot <gobot@golang.org>2024-07-31 15:36:31 +0000
commit0214749fef334f9879287d6eec3f059e803a5270 (patch)
tree83e89285b8b918e9f8dba19f957294d7514fb3c8 /src/cmd/internal/obj
parentd32133af7791325afd30ba999c2e11bf5c82b6f6 (diff)
downloadgo-0214749fef334f9879287d6eec3f059e803a5270.tar.xz
cmd/internal/obj/loong64: rename Class to represent the external symbol address
There is no need to define another C_SECON Class to express short external symbol address, because the external symbol address is unknown in assembler, relocate it in linker. Change-Id: Id9fbd848c43ca63a21f2b6640e947140c26eeaf7 Reviewed-on: https://go-review.googlesource.com/c/go/+/565624 Reviewed-by: Qiqi Huang <huangqiqi@loongson.cn> Reviewed-by: sophie zhao <zhaoxiaolin@loongson.cn> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: abner chenc <chenguoqi@loongson.cn> Reviewed-by: Michael Knyszek <mknyszek@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: abner chenc <chenguoqi@loongson.cn>
Diffstat (limited to 'src/cmd/internal/obj')
-rw-r--r--src/cmd/internal/obj/loong64/a.out.go3
-rw-r--r--src/cmd/internal/obj/loong64/asm.go10
-rw-r--r--src/cmd/internal/obj/loong64/cnames.go3
3 files changed, 6 insertions, 10 deletions
diff --git a/src/cmd/internal/obj/loong64/a.out.go b/src/cmd/internal/obj/loong64/a.out.go
index 23f71fd8ab..251c34c6ab 100644
--- a/src/cmd/internal/obj/loong64/a.out.go
+++ b/src/cmd/internal/obj/loong64/a.out.go
@@ -209,9 +209,8 @@ const (
C_LCON // other 32
C_DCON // other 64 (could subdivide further)
C_SACON // $n(REG) where n <= int12
- C_SECON
C_LACON // $n(REG) where int12 < n <= int32
- C_LECON
+ C_EXTADDR // external symbol address
C_DACON // $n(REG) where int32 < n
C_SBRA
C_LBRA
diff --git a/src/cmd/internal/obj/loong64/asm.go b/src/cmd/internal/obj/loong64/asm.go
index 99cebe3e4e..26ec30af37 100644
--- a/src/cmd/internal/obj/loong64/asm.go
+++ b/src/cmd/internal/obj/loong64/asm.go
@@ -179,12 +179,10 @@ var optab = []Optab{
{AMOVB, C_TLS_LE, C_NONE, C_NONE, C_REG, C_NONE, 54, 16, 0, 0},
{AMOVBU, C_TLS_LE, C_NONE, C_NONE, C_REG, C_NONE, 54, 16, 0, 0},
- {AMOVW, C_SECON, C_NONE, C_NONE, C_REG, C_NONE, 3, 4, 0, 0},
- {AMOVV, C_SECON, C_NONE, C_NONE, C_REG, C_NONE, 3, 4, 0, 0},
{AMOVW, C_SACON, C_NONE, C_NONE, C_REG, C_NONE, 3, 4, REGSP, 0},
{AMOVV, C_SACON, C_NONE, C_NONE, C_REG, C_NONE, 3, 4, REGSP, 0},
- {AMOVW, C_LECON, C_NONE, C_NONE, C_REG, C_NONE, 52, 8, 0, NOTUSETMP},
- {AMOVV, C_LECON, C_NONE, C_NONE, C_REG, C_NONE, 52, 8, 0, NOTUSETMP},
+ {AMOVW, C_EXTADDR, C_NONE, C_NONE, C_REG, C_NONE, 52, 8, 0, NOTUSETMP},
+ {AMOVV, C_EXTADDR, C_NONE, C_NONE, C_REG, C_NONE, 52, 8, 0, NOTUSETMP},
{AMOVW, C_LACON, C_NONE, C_NONE, C_REG, C_NONE, 26, 12, REGSP, 0},
{AMOVV, C_LACON, C_NONE, C_NONE, C_REG, C_NONE, 26, 12, REGSP, 0},
@@ -747,7 +745,7 @@ func (c *ctxt0) aclass(a *obj.Addr) int {
if s.Type == objabi.STLSBSS {
c.ctxt.Diag("taking address of TLS variable is not supported")
}
- return C_LECON
+ return C_EXTADDR
case obj.NAME_AUTO:
if a.Reg == REGSP {
@@ -1684,7 +1682,7 @@ func (c *ctxt0) asmout(p *obj.Prog, o *Optab, out []uint32) {
rel2.Add = p.From.Offset
rel2.Type = objabi.R_LOONG64_ADDR_LO
- case 52: // mov $lext, r
+ case 52: // mov $ext, r
// NOTE: this case does not use REGTMP. If it ever does,
// remove the NOTUSETMP flag in optab.
o1 = OP_IR(c.opir(APCALAU12I), uint32(0), uint32(p.To.Reg))
diff --git a/src/cmd/internal/obj/loong64/cnames.go b/src/cmd/internal/obj/loong64/cnames.go
index 3841296f3a..955c464d2f 100644
--- a/src/cmd/internal/obj/loong64/cnames.go
+++ b/src/cmd/internal/obj/loong64/cnames.go
@@ -21,9 +21,8 @@ var cnames0 = []string{
"LCON",
"DCON",
"SACON",
- "SECON",
"LACON",
- "LECON",
+ "EXTADDR",
"DACON",
"SBRA",
"LBRA",