]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/internal/obj/loong64: rename Class to represent the external symbol address
authorlimeidan <limeidan@loongson.cn>
Fri, 12 Jan 2024 01:58:35 +0000 (09:58 +0800)
committerGopher Robot <gobot@golang.org>
Wed, 31 Jul 2024 15:36:31 +0000 (15:36 +0000)
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>

src/cmd/internal/obj/loong64/a.out.go
src/cmd/internal/obj/loong64/asm.go
src/cmd/internal/obj/loong64/cnames.go

index 23f71fd8ab28a7ab565b5cbbd930c67baf5d8260..251c34c6abe68a41d87098943ac7dac555d754e2 100644 (file)
@@ -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
index 99cebe3e4e1de01b120318d663afd88d37197099..26ec30af37582e05a0924b9ca442d6c692f6ade6 100644 (file)
@@ -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))
index 3841296f3acc5b8dcff187f7fa4d11526b2fa14c..955c464d2fce22ca6956a5364e1391e6bb218595 100644 (file)
@@ -21,9 +21,8 @@ var cnames0 = []string{
        "LCON",
        "DCON",
        "SACON",
-       "SECON",
        "LACON",
-       "LECON",
+       "EXTADDR",
        "DACON",
        "SBRA",
        "LBRA",