]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.link] cmd/link: use new dodata on MIPS(64) and RISCV64
authorCherry Zhang <cherryyz@google.com>
Sat, 25 Apr 2020 01:55:24 +0000 (21:55 -0400)
committerCherry Zhang <cherryyz@google.com>
Mon, 27 Apr 2020 15:31:03 +0000 (15:31 +0000)
They also don't need to do anything for Adddynrel. So we can just
enable it.

Change-Id: If85fceca63a7b3cb5a09e5db224c3018060e86de
Reviewed-on: https://go-review.googlesource.com/c/go/+/229993
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
src/cmd/link/internal/ld/main.go
src/cmd/link/internal/ld/target.go

index 8c86fd7236ce909983d4bbaefec0c9461c3eb338..6893fa87844774b278d3e4cc315f7fb038590339 100644 (file)
@@ -204,8 +204,11 @@ func Main(arch *sys.Arch, theArch Arch) {
                // New dodata() is currently only implemented for selected targets.
                switch {
                case ctxt.IsElf():
-                       if !(ctxt.IsAMD64() || ctxt.Is386() ||
-                               ctxt.IsARM() || ctxt.IsARM64() || ctxt.IsS390X()) {
+                       switch {
+                       case ctxt.Is386(), ctxt.IsAMD64(), ctxt.IsARM(), ctxt.IsARM64(),
+                               ctxt.IsMIPS(), ctxt.IsMIPS64(), ctxt.IsRISCV64(), ctxt.IsS390X():
+                               // supported
+                       default:
                                *flagnewDoData = false
                        }
                case ctxt.IsDarwin():
index 78e41f09be614993dd74ba051789bd8d87475286..102b6c543607b9ed38ca3896ec03d7fb6a4f019f 100644 (file)
@@ -100,10 +100,22 @@ func (t *Target) IsAMD64() bool {
        return t.Arch.Family == sys.AMD64
 }
 
+func (t *Target) IsMIPS() bool {
+       return t.Arch.Family == sys.MIPS
+}
+
+func (t *Target) IsMIPS64() bool {
+       return t.Arch.Family == sys.MIPS64
+}
+
 func (t *Target) IsPPC64() bool {
        return t.Arch.Family == sys.PPC64
 }
 
+func (t *Target) IsRISCV64() bool {
+       return t.Arch.Family == sys.RISCV64
+}
+
 func (t *Target) IsS390X() bool {
        return t.Arch.Family == sys.S390X
 }