mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/link: add .go.buildinfo in XCOFF symbol table
.go.buildinfo must be added to the symbol table on AIX. Otherwise, ld won't be able to handle its relocations. This patch also make ".data" the default section for all symbols inside the data segment. Change-Id: I83ac2bf1050e0ef6ef9c96ff793efd4ddc8e98d7 Reviewed-on: https://go-review.googlesource.com/c/go/+/174298 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
9f12e2e04b
commit
0c9e0c257b
2 changed files with 15 additions and 6 deletions
|
|
@ -2265,11 +2265,23 @@ func genasmsym(ctxt *Link, put func(*Link, *sym.Symbol, string, SymbolType, int6
|
|||
}
|
||||
}
|
||||
|
||||
for _, s := range ctxt.Syms.Allsym {
|
||||
shouldBeInSymbolTable := func(s *sym.Symbol) bool {
|
||||
if s.Attr.NotInSymbolTable() {
|
||||
continue
|
||||
return false
|
||||
}
|
||||
if ctxt.HeadType == objabi.Haix && s.Name == ".go.buildinfo" {
|
||||
// On AIX, .go.buildinfo must be in the symbol table as
|
||||
// it has relocations.
|
||||
return true
|
||||
}
|
||||
if (s.Name == "" || s.Name[0] == '.') && !s.IsFileLocal() && s.Name != ".rathole" && s.Name != ".TOC." {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
for _, s := range ctxt.Syms.Allsym {
|
||||
if !shouldBeInSymbolTable(s) {
|
||||
continue
|
||||
}
|
||||
switch s.Type {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue