aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/internal/obj/arm
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2015-07-30 10:28:44 -0400
committerRuss Cox <rsc@golang.org>2015-07-30 15:47:31 +0000
commita1e422071cd8122b4b93bbdeb02d0ea646519955 (patch)
tree449d0206d98b072105b4c351dcbaaf6d6a8bdee4 /src/cmd/internal/obj/arm
parentab714a70dcad78e2bd7004638843052343c6f2c4 (diff)
downloadgo-a1e422071cd8122b4b93bbdeb02d0ea646519955.tar.xz
cmd/internal/obj/arm: fix line numbers after constant pool
If a function is large enough to need to flush the constant pool mid-function, the line number assignment code was forcing the line numbers not just for the constant pool but for all the instructions that follow it. This made the line number information completely wrong for all but the beginning of large functions on arm. Same problem in code copied into arm64. This broke runtime/trace's TestTraceSymbolize. Fixes arm build. Change-Id: I84d9fb2c798c4085f69b68dc766ab4800c7a6ca4 Reviewed-on: https://go-review.googlesource.com/12894 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/cmd/internal/obj/arm')
-rw-r--r--src/cmd/internal/obj/arm/asm5.go15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/cmd/internal/obj/arm/asm5.go b/src/cmd/internal/obj/arm/asm5.go
index f55357cd4b..e50dcf56f8 100644
--- a/src/cmd/internal/obj/arm/asm5.go
+++ b/src/cmd/internal/obj/arm/asm5.go
@@ -862,17 +862,16 @@ func flushpool(ctxt *obj.Link, p *obj.Prog, skip int, force int) bool {
ctxt.Elitrl = q
}
+ // The line number for constant pool entries doesn't really matter.
+ // We set it to the line number of the preceding instruction so that
+ // there are no deltas to encode in the pc-line tables.
+ for q := ctxt.Blitrl; q != nil; q = q.Link {
+ q.Lineno = p.Lineno
+ }
+
ctxt.Elitrl.Link = p.Link
p.Link = ctxt.Blitrl
- // BUG(minux): how to correctly handle line number for constant pool entries?
- // for now, we set line number to the last instruction preceding them at least
- // this won't bloat the .debug_line tables
- for ctxt.Blitrl != nil {
- ctxt.Blitrl.Lineno = p.Lineno
- ctxt.Blitrl = ctxt.Blitrl.Link
- }
-
ctxt.Blitrl = nil /* BUG: should refer back to values until out-of-range */
ctxt.Elitrl = nil
pool.size = 0