]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: fix broken arm builds
authorRuss Cox <rsc@golang.org>
Mon, 29 Jun 2015 17:32:09 +0000 (13:32 -0400)
committerRuss Cox <rsc@golang.org>
Mon, 29 Jun 2015 17:33:23 +0000 (17:33 +0000)
Change-Id: I08de33aacb3fc932722286d69b1dd70ffe787c89
Reviewed-on: https://go-review.googlesource.com/11697
Reviewed-by: Russ Cox <rsc@golang.org>
src/runtime/symtab.go

index f02f5924131019d26bf2c4e94641d1d323cef179..44d08e0e7adbbc115ec09875fd93e15a22cf0ae7 100644 (file)
@@ -130,10 +130,18 @@ func moduledataverify1(datap *moduledata) {
                }
 
                if debugPcln || nftab-i < 5 {
+                       // Check a PC near but not at the very end.
+                       // The very end might be just padding that is not covered by the tables.
+                       // No architecture rounds function entries to more than 16 bytes,
+                       // but if one came along we'd need to subtract more here.
+                       end := datap.ftab[i+1].entry - 16
+                       if end < datap.ftab[i].entry {
+                               end = datap.ftab[i].entry
+                       }
                        f := (*_func)(unsafe.Pointer(&datap.pclntable[datap.ftab[i].funcoff]))
-                       pcvalue(f, f.pcfile, datap.ftab[i+1].entry-1, true)
-                       pcvalue(f, f.pcln, datap.ftab[i+1].entry-1, true)
-                       pcvalue(f, f.pcsp, datap.ftab[i+1].entry-1, true)
+                       pcvalue(f, f.pcfile, end, true)
+                       pcvalue(f, f.pcln, end, true)
+                       pcvalue(f, f.pcsp, end, true)
                }
        }