The __nl_symbol_ptr is not a common section name anymore. LLVM prefers
__got for GOT symbols in the __DATA_CONST segment.
Note that the Go linker used to place the GOT section in the __DATA
segment, but since CL 644055 we place it in the __DATA_CONST segment.
Updates #71416.
Cq-Include-Trybots: luci.golang.try:gotip-darwin-amd64-longtest
Change-Id: Icb776e19855eaabb4777a9b1eb433497842413b4
Reviewed-on: https://go-review.googlesource.com/c/go/+/652555
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
sb.SetType(sym.SMACHOPLT)
sb.SetReachable(true)
- s = ctxt.loader.LookupOrCreateSym(".got", 0) // will be __nl_symbol_ptr
+ s = ctxt.loader.LookupOrCreateSym(".got", 0) // will be __got
sb = ctxt.loader.MakeSymbolUpdater(s)
if ctxt.UseRelro() {
sb.SetType(sym.SMACHORELROSECT)
}
if sect.Name == ".got" {
- msect.name = "__nl_symbol_ptr"
+ msect.name = "__got"
msect.flag = S_NON_LAZY_SYMBOL_POINTERS
msect.res1 = uint32(ctxt.loader.SymSize(ctxt.ArchSyms.LinkEditPLT) / 4) /* offset into indirect symbol table */
}
args: []string{"-ldflags", "-linkmode=internal"},
prog: prog,
mustInternalLink: true,
- wantSecsRO: []string{"__nl_symbol_ptr", "__rodata", "__itablink", "__typelink", "__gosymtab", "__gopclntab"},
+ wantSecsRO: []string{"__got", "__rodata", "__itablink", "__typelink", "__gosymtab", "__gopclntab"},
},
{
name: "linkmode-external",