1
0
mirror of https://github.com/golang/go synced 2024-11-16 22:14:45 -07:00

cmd/link: improve error for missing SDYNIMPORT support on mips/mips64

Issue an error (instead of crashing) when encountering a symbol that
requires dynamic relocations on mips/mips64. The dynimport support is
in progress, but is not done yet, so rather than crashing, print a
message indicating that the feature is not yet implemented and exit.

Fixes #58240.

Change-Id: I9ad64c89e4f7b4b180964b35ad1d72d375f2df7f
Reviewed-on: https://go-review.googlesource.com/c/go/+/466895
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Joel Sing <joel@sing.id.au>
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Than McIntosh <thanm@google.com>
This commit is contained in:
Than McIntosh 2023-02-09 09:08:44 -05:00
parent fb79da2991
commit 7d57a9ce82
2 changed files with 16 additions and 0 deletions

View File

@ -34,6 +34,7 @@ import (
"cmd/internal/objabi"
"cmd/internal/sys"
"cmd/link/internal/ld"
"cmd/link/internal/loader"
"internal/buildcfg"
)
@ -52,6 +53,7 @@ func Init() (*sys.Arch, ld.Arch) {
Dwarfregsp: DWARFREGSP,
Dwarfreglr: DWARFREGLR,
Adddynrel: adddynrel,
Archinit: archinit,
Archreloc: archreloc,
Archrelocvariant: archrelocvariant,
@ -97,3 +99,9 @@ func archinit(ctxt *ld.Link) {
}
}
}
func adddynrel(target *ld.Target, ldr *loader.Loader, syms *ld.ArchSyms, s loader.Sym, r loader.Reloc, rIdx int) bool {
ld.Exitf("adddynrel currently unimplemented for MIPS")
return false
}

View File

@ -34,6 +34,7 @@ import (
"cmd/internal/objabi"
"cmd/internal/sys"
"cmd/link/internal/ld"
"cmd/link/internal/loader"
"internal/buildcfg"
)
@ -51,6 +52,7 @@ func Init() (*sys.Arch, ld.Arch) {
Minalign: minAlign,
Dwarfregsp: dwarfRegSP,
Dwarfreglr: dwarfRegLR,
Adddynrel: adddynrel,
Archinit: archinit,
Archreloc: archreloc,
Archrelocvariant: archrelocvariant,
@ -107,3 +109,9 @@ func archinit(ctxt *ld.Link) {
}
}
}
func adddynrel(target *ld.Target, ldr *loader.Loader, syms *ld.ArchSyms, s loader.Sym, r loader.Reloc, rIdx int) bool {
ld.Exitf("adddynrel currently unimplemented for MIPS64")
return false
}