1
0
mirror of https://github.com/golang/go synced 2024-11-18 03:44:46 -07:00

[dev.link] cmd/link: remove ARM64 special handling of GC data in shared libraries

The special case is no longer needed, didn't actually work, and
we no longer even save this map anywhere (see CL 240621 for more
information).

Change-Id: I19bcf32cace22decf50fd6414d4519cc51cbb0be
Reviewed-on: https://go-review.googlesource.com/c/go/+/241982
Reviewed-by: Austin Clements <austin@google.com>
This commit is contained in:
Cherry Zhang 2020-07-10 16:09:37 -04:00
parent 86f53c2a3c
commit f3a29d3a34

View File

@ -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})
}