diff options
Diffstat (limited to 'src/runtime')
| -rw-r--r-- | src/runtime/symtab.go | 22 | ||||
| -rw-r--r-- | src/runtime/type.go | 5 |
2 files changed, 14 insertions, 13 deletions
diff --git a/src/runtime/symtab.go b/src/runtime/symtab.go index 5dbf7a9d31..1bd9a0c188 100644 --- a/src/runtime/symtab.go +++ b/src/runtime/symtab.go @@ -412,17 +412,17 @@ type moduledata struct { findfunctab uintptr minpc, maxpc uintptr - text, etext uintptr - noptrdata, enoptrdata uintptr - data, edata uintptr - bss, ebss uintptr - noptrbss, enoptrbss uintptr - covctrs, ecovctrs uintptr - end, gcdata, gcbss uintptr - types, etypedesc, etypes uintptr - rodata uintptr - gofunc uintptr // go.func.* - epclntab uintptr + text, etext uintptr + noptrdata, enoptrdata uintptr + data, edata uintptr + bss, ebss uintptr + noptrbss, enoptrbss uintptr + covctrs, ecovctrs uintptr + end, gcdata, gcbss uintptr + types, typedesclen, etypes uintptr + rodata uintptr + gofunc uintptr // go.func.* + epclntab uintptr textsectmap []textsect itablinks []*itab diff --git a/src/runtime/type.go b/src/runtime/type.go index 893c79404e..c5262ccd0f 100644 --- a/src/runtime/type.go +++ b/src/runtime/type.go @@ -514,7 +514,7 @@ func moduleTypelinks(md *moduledata) []*_type { } // Allocate a very rough estimate of the number of types. - ret := make([]*_type, 0, (md.etypedesc-md.types)/(2*unsafe.Sizeof(_type{}))) + ret := make([]*_type, 0, md.typedesclen/(2*unsafe.Sizeof(_type{}))) td := md.types @@ -522,7 +522,8 @@ func moduleTypelinks(md *moduledata) []*_type { // cmd/link/internal/data.go createRelroSect in allocateDataSections. td++ - for td < md.etypedesc { + etypedesc := md.types + md.typedesclen + for td < etypedesc { // TODO: The fact that type descriptors are aligned to // 0x20 does not make sense. td = alignUp(td, 0x20) |
