From bcad6d6619188cb45dc14ab9f211c2ef61301e1c Mon Sep 17 00:00:00 2001 From: "1053226965@qq.com" <1053226965@qq.com> Date: Mon, 11 Sep 2023 14:10:15 +0800 Subject: [PATCH] runtime: the last section should be len(md.textsectmap)-1 --- src/runtime/symtab.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/symtab.go b/src/runtime/symtab.go index 129af01a34..0cc3085f6a 100644 --- a/src/runtime/symtab.go +++ b/src/runtime/symtab.go @@ -622,7 +622,7 @@ func (md *moduledata) textOff(pc uintptr) (uint32, bool) { } end := sect.baseaddr + (sect.end - sect.vaddr) // For the last section, include the end address (etext), as it is included in the functab. - if i == len(md.textsectmap) { + if i == len(md.textsectmap)-1 { end++ } if pc < end {