]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.link] all: merge branch 'master' into dev.link
authorCherry Zhang <cherryyz@google.com>
Fri, 10 Jul 2020 18:54:13 +0000 (14:54 -0400)
committerCherry Zhang <cherryyz@google.com>
Fri, 10 Jul 2020 18:54:13 +0000 (14:54 -0400)
Change-Id: I644cfc9dfd6e024a0d62bbd226db8639e4a87dc7

1  2 
src/cmd/link/internal/ld/decodesym.go
src/cmd/link/internal/ld/lib.go

Simple merge
index 02ae26ec8db7c6c1928498faa21ed656274628f0,b0a9613e4f478fda55a44b3c5dad81432a30ae33..4121124eb0d7afae81ea42c650a1704138bce06e
@@@ -97,38 -100,78 +97,40 @@@ import 
  // relocation.  Rather than allowing them universal access to all symbols,
  // we keep a subset for relocation application.
  type ArchSyms struct {
 -      TOC    *sym.Symbol
 -      DotTOC []*sym.Symbol // for each version
 -
 -      GOT    *sym.Symbol
 -      PLT    *sym.Symbol
 -      GOTPLT *sym.Symbol
 -
 -      Tlsg      *sym.Symbol
 -      Tlsoffset int
 -
 -      Dynamic *sym.Symbol
 -      DynSym  *sym.Symbol
 -      DynStr  *sym.Symbol
 -
 -      // Elf specific
 -      Rel     *sym.Symbol
 -      Rela    *sym.Symbol
 -      RelPLT  *sym.Symbol
 -      RelaPLT *sym.Symbol
 +      Rel     loader.Sym
 +      Rela    loader.Sym
 +      RelPLT  loader.Sym
 +      RelaPLT loader.Sym
  
 -      // Darwin symbols
 -      LinkEditGOT *sym.Symbol
 -      LinkEditPLT *sym.Symbol
 +      LinkEditGOT loader.Sym
 +      LinkEditPLT loader.Sym
  
 -      // ----- loader.Sym equivalents -----
 +      TOC    loader.Sym
 +      DotTOC []loader.Sym // for each version
  
 -      Rel2     loader.Sym
 -      Rela2    loader.Sym
 -      RelPLT2  loader.Sym
 -      RelaPLT2 loader.Sym
 +      GOT    loader.Sym
 +      PLT    loader.Sym
 +      GOTPLT loader.Sym
  
 -      LinkEditGOT2 loader.Sym
 -      LinkEditPLT2 loader.Sym
 -
 -      TOC2    loader.Sym
 -      DotTOC2 []loader.Sym // for each version
 -
 -      GOT2    loader.Sym
 -      PLT2    loader.Sym
 -      GOTPLT2 loader.Sym
 -
 -      Tlsg2 loader.Sym
 +      Tlsg      loader.Sym
 +      Tlsoffset int
  
 -      Dynamic2 loader.Sym
 -      DynSym2  loader.Sym
 -      DynStr2  loader.Sym
 +      Dynamic loader.Sym
 +      DynSym  loader.Sym
 +      DynStr  loader.Sym
  }
  
 -const BeforeLoadlibFull = 1
 -const AfterLoadlibFull = 2
 -
 -// mkArchSym is a helper for setArchSyms, invoked once before loadlibfull
 -// and once after. On the first call it creates a loader.Sym with the
 -// specified name, and on the second call a corresponding sym.Symbol.
 -func (ctxt *Link) mkArchSym(which int, name string, ver int, ls *loader.Sym, ss **sym.Symbol) {
 -      if which == BeforeLoadlibFull {
 -              *ls = ctxt.loader.LookupOrCreateSym(name, ver)
 -              ctxt.loader.SetAttrReachable(*ls, true)
 -      } else {
 -              *ss = ctxt.loader.Syms[*ls]
 -      }
 +// mkArchSym is a helper for setArchSyms, to set up a special symbol.
 +func (ctxt *Link) mkArchSym(name string, ver int, ls *loader.Sym) {
 +      *ls = ctxt.loader.LookupOrCreateSym(name, ver)
++      ctxt.loader.SetAttrReachable(*ls, true)
  }
  
  // mkArchVecSym is similar to  setArchSyms, but operates on elements within
  // a slice, where each element corresponds to some symbol version.
 -func (ctxt *Link) mkArchSymVec(which int, name string, ver int, ls []loader.Sym, ss []*sym.Symbol) {
 -      if which == BeforeLoadlibFull {
 -              ls[ver] = ctxt.loader.LookupOrCreateSym(name, ver)
 -              ctxt.loader.SetAttrReachable(ls[ver], true)
 -      } else if ls[ver] != 0 {
 -              ss[ver] = ctxt.loader.Syms[ls[ver]]
 -      }
 +func (ctxt *Link) mkArchSymVec(name string, ver int, ls []loader.Sym) {
 +      ls[ver] = ctxt.loader.LookupOrCreateSym(name, ver)
++      ctxt.loader.SetAttrReachable(ls[ver], true)
  }
  
  // setArchSyms sets up the ArchSyms structure, and must be called before