The code meant to check if it is the last section, which is
i === len(md.textsectmap)-1. The -1 was missing.
Change-Id: Ifbb9e40df730abe3bec20fde5f56f5c75dfd9e8f
Reviewed-on: https://go-review.googlesource.com/c/go/+/527795
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Than McIntosh <thanm@google.com>
}
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 {