aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/link/internal/ld/lib.go
diff options
context:
space:
mode:
authorCherry Mui <cherryyz@google.com>2023-05-04 17:09:49 -0400
committerCherry Mui <cherryyz@google.com>2023-05-05 19:20:01 +0000
commitf90bb8a38f2f1ed2109f8fa88fb90a5c2db1f3fe (patch)
treecece8ec0b7f198ee24034f36848dee831a131211 /src/cmd/link/internal/ld/lib.go
parent26899ef3ee7cd3d9e663e6f792c93bb411c863db (diff)
downloadgo-f90bb8a38f2f1ed2109f8fa88fb90a5c2db1f3fe.tar.xz
cmd/link: remove elfsetstring out of the loader
Currently, we pass elfsetstring to the loader as a callback, for a special case of Addstring. This is only used for ELF when adding strings to the section header string table. Move the logic to the caller instead, so the loader would not have this special case. Change-Id: Icfb91f380fe4ba435985c3019681597932f58242 Reviewed-on: https://go-review.googlesource.com/c/go/+/492718 Run-TryBot: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
Diffstat (limited to 'src/cmd/link/internal/ld/lib.go')
-rw-r--r--src/cmd/link/internal/ld/lib.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go
index 03b13da37a..0febb3081f 100644
--- a/src/cmd/link/internal/ld/lib.go
+++ b/src/cmd/link/internal/ld/lib.go
@@ -528,8 +528,7 @@ func (ctxt *Link) loadlib() {
default:
log.Fatalf("invalid -strictdups flag value %d", *FlagStrictDups)
}
- elfsetstring1 := func(str string, off int) { elfsetstring(ctxt, 0, str, off) }
- ctxt.loader = loader.NewLoader(flags, elfsetstring1, &ctxt.ErrorReporter.ErrorReporter)
+ ctxt.loader = loader.NewLoader(flags, &ctxt.ErrorReporter.ErrorReporter)
ctxt.ErrorReporter.SymName = func(s loader.Sym) string {
return ctxt.loader.SymName(s)
}