No longer needed.
Change-Id: I7cd08915e4731c4546414340df69521e2347367f
Reviewed-on: https://go-review.googlesource.com/c/go/+/233521
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
return uint32(ehdr.shnum) * ELF32SHDRSIZE
}
-func elfsetstring2(ctxt *Link, s loader.Sym, str string, off int) {
+func elfsetstring(ctxt *Link, s loader.Sym, str string, off int) {
if nelfstr >= len(elfstr) {
ctxt.Errorf(s, "too many elf strings")
errorexit()
+++ /dev/null
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package ld
-
-import "cmd/link/internal/sym"
-
-// Temporary dumping around for sym.Symbol version of helper
-// functions in elf.go, still being used for some archs/oses.
-// FIXME: get rid of this file when dodata() is completely
-// converted and the sym.Symbol functions are not needed.
-
-func elfsetstring(s *sym.Symbol, str string, off int) {
- if nelfstr >= len(elfstr) {
- Errorf(s, "too many elf strings")
- errorexit()
- }
-
- elfstr[nelfstr].s = str
- elfstr[nelfstr].off = off
- nelfstr++
-}
default:
log.Fatalf("invalid -strictdups flag value %d", *FlagStrictDups)
}
- ctxt.loader = loader.NewLoader(flags, elfsetstring, &ctxt.ErrorReporter.ErrorReporter)
+ elfsetstring1 := func(str string, off int) { elfsetstring(ctxt, 0, str, off) }
+ ctxt.loader = loader.NewLoader(flags, elfsetstring1, &ctxt.ErrorReporter.ErrorReporter)
ctxt.ErrorReporter.SymName = func(s loader.Sym) string {
return ctxt.loader.SymName(s)
}
nonPkgRef
)
-type elfsetstringFunc func(s *sym.Symbol, str string, off int)
+type elfsetstringFunc func(str string, off int)
// extSymPayload holds the payload (data + relocations) for linker-synthesized
// external symbols (note that symbol value is stored in a separate slice).
}
func mkLoader() *Loader {
- edummy := func(s *sym.Symbol, str string, off int) {}
+ edummy := func(str string, off int) {}
er := ErrorReporter{}
ldr := NewLoader(0, edummy, &er)
er.ldr = ldr
r := sb.size
if sb.name == ".shstrtab" {
// FIXME: find a better mechanism for this
- sb.l.elfsetstring(nil, str, int(r))
+ sb.l.elfsetstring(str, int(r))
}
sb.data = append(sb.data, str...)
sb.data = append(sb.data, 0)