diff --git a/src/cmd/link/internal/ld/main.go b/src/cmd/link/internal/ld/main.go index 8c86fd7236c..6893fa87844 100644 --- a/src/cmd/link/internal/ld/main.go +++ b/src/cmd/link/internal/ld/main.go @@ -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(): diff --git a/src/cmd/link/internal/ld/target.go b/src/cmd/link/internal/ld/target.go index 78e41f09be6..102b6c54360 100644 --- a/src/cmd/link/internal/ld/target.go +++ b/src/cmd/link/internal/ld/target.go @@ -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 }