aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/internal/obj/arm
diff options
context:
space:
mode:
authorDavid Chase <drchase@google.com>2018-03-07 16:21:47 -0500
committerDavid Chase <drchase@google.com>2018-03-09 23:17:18 +0000
commit0eacf8cbdfaec174f29fd8c734ac2f02442af79a (patch)
tree9d1eda633654e0f7328e1676d18273fbe1f3f55f /src/cmd/internal/obj/arm
parent99c30211b1e0b3ac4e5d32f3ae5eaf759c23195f (diff)
downloadgo-0eacf8cbdfaec174f29fd8c734ac2f02442af79a.tar.xz
cmd/compile: add DWARF reg defs & fix 32-bit location list bug
Before DWARF location lists can be turned on, 3 bugs need fixing. This CL addresses two -- lack of register definitions for various architectures, and bugs on 32-bit platforms. The third bug comes later. Passes GO_GCFLAGS=-dwarflocationlists ./run.bash -no-rebuild (-no-rebuild because the map dependence causes trouble) Change-Id: I4223b48ade84763e4b048e4aeb81149f082c7bc7 Reviewed-on: https://go-review.googlesource.com/99255 Run-TryBot: David Chase <drchase@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src/cmd/internal/obj/arm')
-rw-r--r--src/cmd/internal/obj/arm/a.out.go14
-rw-r--r--src/cmd/internal/obj/arm/obj5.go13
2 files changed, 21 insertions, 6 deletions
diff --git a/src/cmd/internal/obj/arm/a.out.go b/src/cmd/internal/obj/arm/a.out.go
index d4d9510230..358f329b4f 100644
--- a/src/cmd/internal/obj/arm/a.out.go
+++ b/src/cmd/internal/obj/arm/a.out.go
@@ -110,6 +110,20 @@ const (
FREGTMP = REG_F15
)
+// http://infocenter.arm.com/help/topic/com.arm.doc.ihi0040b/IHI0040B_aadwarf.pdf
+var ARMDWARFRegisters = map[int16]int16{}
+
+func init() {
+ // f assigns dwarfregisters[from:to] = (base):(step*(to-from)+base)
+ f := func(from, to, base, step int16) {
+ for r := int16(from); r <= to; r++ {
+ ARMDWARFRegisters[r] = step*(r-from) + base
+ }
+ }
+ f(REG_R0, REG_R15, 0, 1)
+ f(REG_F0, REG_F15, 64, 2) // Use d0 through D15, aka S0, S2, ..., S30
+}
+
const (
C_NONE = iota
C_REG
diff --git a/src/cmd/internal/obj/arm/obj5.go b/src/cmd/internal/obj/arm/obj5.go
index 2046649e38..82ca301205 100644
--- a/src/cmd/internal/obj/arm/obj5.go
+++ b/src/cmd/internal/obj/arm/obj5.go
@@ -885,10 +885,11 @@ var unaryDst = map[obj.As]bool{
}
var Linkarm = obj.LinkArch{
- Arch: sys.ArchARM,
- Init: buildop,
- Preprocess: preprocess,
- Assemble: span5,
- Progedit: progedit,
- UnaryDst: unaryDst,
+ Arch: sys.ArchARM,
+ Init: buildop,
+ Preprocess: preprocess,
+ Assemble: span5,
+ Progedit: progedit,
+ UnaryDst: unaryDst,
+ DWARFRegisters: ARMDWARFRegisters,
}