Skip to content

Commit 7d57a9c

Browse files
committed
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 <[email protected]> Reviewed-by: Joel Sing <[email protected]> Reviewed-by: David Chase <[email protected]> Run-TryBot: Than McIntosh <[email protected]>
1 parent fb79da2 commit 7d57a9c

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/cmd/link/internal/mips/obj.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import (
3434
"cmd/internal/objabi"
3535
"cmd/internal/sys"
3636
"cmd/link/internal/ld"
37+
"cmd/link/internal/loader"
3738
"internal/buildcfg"
3839
)
3940

@@ -52,6 +53,7 @@ func Init() (*sys.Arch, ld.Arch) {
5253
Dwarfregsp: DWARFREGSP,
5354
Dwarfreglr: DWARFREGLR,
5455

56+
Adddynrel: adddynrel,
5557
Archinit: archinit,
5658
Archreloc: archreloc,
5759
Archrelocvariant: archrelocvariant,
@@ -97,3 +99,9 @@ func archinit(ctxt *ld.Link) {
9799
}
98100
}
99101
}
102+
103+
func adddynrel(target *ld.Target, ldr *loader.Loader, syms *ld.ArchSyms, s loader.Sym, r loader.Reloc, rIdx int) bool {
104+
ld.Exitf("adddynrel currently unimplemented for MIPS")
105+
return false
106+
107+
}

src/cmd/link/internal/mips64/obj.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import (
3434
"cmd/internal/objabi"
3535
"cmd/internal/sys"
3636
"cmd/link/internal/ld"
37+
"cmd/link/internal/loader"
3738
"internal/buildcfg"
3839
)
3940

@@ -51,6 +52,7 @@ func Init() (*sys.Arch, ld.Arch) {
5152
Minalign: minAlign,
5253
Dwarfregsp: dwarfRegSP,
5354
Dwarfreglr: dwarfRegLR,
55+
Adddynrel: adddynrel,
5456
Archinit: archinit,
5557
Archreloc: archreloc,
5658
Archrelocvariant: archrelocvariant,
@@ -107,3 +109,9 @@ func archinit(ctxt *ld.Link) {
107109
}
108110
}
109111
}
112+
113+
func adddynrel(target *ld.Target, ldr *loader.Loader, syms *ld.ArchSyms, s loader.Sym, r loader.Reloc, rIdx int) bool {
114+
ld.Exitf("adddynrel currently unimplemented for MIPS64")
115+
return false
116+
117+
}

0 commit comments

Comments
 (0)