]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link: remove special cases for relocations in .go.buildinfo
authorRuss Cox <rsc@golang.org>
Wed, 1 Feb 2023 17:18:39 +0000 (12:18 -0500)
committerGopher Robot <gobot@golang.org>
Thu, 2 Feb 2023 15:18:00 +0000 (15:18 +0000)
.go.buildinfo has no relocations anymore, as of Go 1.18.

Change-Id: I98369c6a0ef07ada770eaa12f6f56c210e812abc
Reviewed-on: https://go-review.googlesource.com/c/go/+/464436
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Russ Cox <rsc@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
src/cmd/link/internal/ld/data.go
src/cmd/link/internal/ld/xcoff.go

index 925e554b1d9db14e41c36c96a2312ef9591d182b..05c6da3e3bbf43c6174186823f03c7647b199efb 100644 (file)
@@ -2246,14 +2246,6 @@ func (ctxt *Link) textbuildid() {
 }
 
 func (ctxt *Link) buildinfo() {
-       if ctxt.linkShared || ctxt.BuildMode == BuildModePlugin {
-               // -linkshared and -buildmode=plugin get confused
-               // about the relocations in go.buildinfo
-               // pointing at the other data sections.
-               // The version information is only available in executables.
-               return
-       }
-
        // Write the buildinfo symbol, which go version looks for.
        // The code reading this data is in package debug/buildinfo.
        ldr := ctxt.loader
index 1265c458feff142451c7f840b1bfda85753529bc..7b8a134221c6e6edf3c5100b91e61b9ac6dfead2 100644 (file)
@@ -1093,11 +1093,6 @@ func (f *xcoffFile) asmaixsym(ctxt *Link) {
        }
 
        shouldBeInSymbolTable := func(s loader.Sym, name string) bool {
-               if name == ".go.buildinfo" {
-                       // On AIX, .go.buildinfo must be in the symbol table as
-                       // it has relocations.
-                       return true
-               }
                if ldr.AttrNotInSymbolTable(s) {
                        return false
                }