diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go index 4121124eb0..a489da02bc 100644 --- a/src/cmd/link/internal/ld/lib.go +++ b/src/cmd/link/internal/ld/lib.go @@ -2038,7 +2038,6 @@ func ldshlibsyms(ctxt *Link, shlib string) { Errorf(nil, "cannot read symbols from shared library: %s", libpath) return } - gcdataLocations := make(map[uint64]loader.Sym) for _, elfsym := range syms { if elf.ST_TYPE(elfsym.Info) == elf.STT_NOTYPE || elf.ST_TYPE(elfsym.Info) == elf.STT_SECTION { continue @@ -2085,7 +2084,6 @@ func ldshlibsyms(ctxt *Link, shlib string) { sname := l.SymName(s) if strings.HasPrefix(sname, "type.") && !strings.HasPrefix(sname, "type..") { su.SetData(readelfsymboldata(ctxt, f, &elfsym)) - gcdataLocations[elfsym.Value+2*uint64(ctxt.Arch.PtrSize)+8+1*uint64(ctxt.Arch.PtrSize)] = s } } @@ -2106,28 +2104,6 @@ func ldshlibsyms(ctxt *Link, shlib string) { su.AddReloc(loader.Reloc{Sym: s}) } } - if ctxt.Arch.Family == sys.ARM64 { - for _, sect := range f.Sections { - if sect.Type == elf.SHT_RELA { - var rela elf.Rela64 - rdr := sect.Open() - for { - err := binary.Read(rdr, f.ByteOrder, &rela) - if err == io.EOF { - break - } else if err != nil { - Errorf(nil, "reading relocation failed %v", err) - return - } - t := elf.R_AARCH64(rela.Info & 0xffff) - if t != elf.R_AARCH64_RELATIVE { - continue - } - } - } - } - } - ctxt.Shlibs = append(ctxt.Shlibs, Shlib{Path: libpath, Hash: hash, Deps: deps, File: f}) }