ARM MC: Fix the initial DWARF CFI unwind info at the start of a function
authorMark Seaborn <mseaborn@chromium.org>
Mon, 27 Jan 2014 22:38:14 +0000 (22:38 +0000)
committerMark Seaborn <mseaborn@chromium.org>
Mon, 27 Jan 2014 22:38:14 +0000 (22:38 +0000)
commit66aefa805b0c0be252bf092816464eec566b713b
tree8ed88ff34d61f3f4009242ee906dbf3724014661
parent410f38e01597120b41e406ec1cea69127463f9e5
ARM MC: Fix the initial DWARF CFI unwind info at the start of a function

This brings MC into line with GNU 'as' on ARM, and it brings the ARM
target into line with most other LLVM targets, which declare the
initial CFI state with addInitialFrameState().

Without this, functions generated with .cfi_startproc/endproc on ARM
will tend to cause GDB to abort with:
  gdb/dwarf2-frame.c:1132: internal-error: Unknown CFA rule.

I've also tested this by comparing the output of "readelf -w" on the
object files produced by llvm-mc and gas when given the .s file added
here.

This change is part of addressing PR18636.

Differential Revision: http://llvm-reviews.chandlerc.com/D2597

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200255 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp
test/MC/ARM/dwarf-cfi-initial-state.s [new file with mode: 0644]