]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
aarch64: Add default cfi rule to restore SP from CFA address.
authorMark Wielaard <mark@klomp.org>
Wed, 11 Apr 2018 08:37:45 +0000 (10:37 +0200)
committerMark Wielaard <mark@klomp.org>
Fri, 13 Apr 2018 11:37:16 +0000 (13:37 +0200)
The CFA is set by default to the stack pointer of the previous frame.
So that is also how we can always restore the SP. This default aarch64
CFI rule is necessary on Fedora 28 with GCC8 to make the run-deleted.sh
and run-backtrace-dwarf.sh testcases work.

Signed-off-by: Mark Wielaard <mark@klomp.org>
backends/ChangeLog
backends/aarch64_cfi.c
tests/ChangeLog
tests/run-addrcfi.sh

index b52580132cce76ad5871996537cad92f2fb3b4dc..57baea09546206ce506e68915e24067b2fd314f4 100644 (file)
@@ -1,3 +1,8 @@
+2018-04-11  Mark Wielaard  <mark@klomp.org>
+
+       * aarch64_cfi.c (aarch64_abi_cfi): Add rule for restoring SP from
+       CFA address.
+
 2018-02-15  Mark Wielaard  <mark@klomp.org>
 
        * ppc_initreg.c: Include ptrace.h before system.h and sys/user.h.
index acbb9b69529573c541e8f3d5c95497e367cd7919..a5579ab1dba60dc238829c2734691bdef3d14f0d 100644 (file)
@@ -1,5 +1,5 @@
-/* arm ABI-specified defaults for DWARF CFI.
-   Copyright (C) 2013 Red Hat, Inc.
+/* arm64 ABI-specified defaults for DWARF CFI.
+   Copyright (C) 2013, 2018 Red Hat, Inc.
    This file is part of elfutils.
 
    This file is free software; you can redistribute it and/or modify
@@ -62,6 +62,9 @@ aarch64_abi_cfi (Ebl *ebl __attribute__ ((unused)), Dwarf_CIE *abi_info)
       /* The Frame Pointer (FP, r29) and Link Register (LR, r30).  */
       SV (29), SV (30),
 
+      /* The Stack Pointer (r31) is restored from CFA address by default.  */
+      DW_CFA_val_offset, ULEB128_7 (31), ULEB128_7 (0),
+
       /* Callee-saved fpregs v8-v15.  v0 == 64.  */
       SV (72), SV (73), SV (74), SV (75),
       SV (76), SV (77), SV (78), SV (79),
index bcb24dc4daaf26ee2a72577105f3aeb56c9914fd..c9403fbf9af6d38852a0d9e9d7d6d43967c55682 100644 (file)
@@ -1,3 +1,7 @@
+2018-04-11  Mark Wielaard  <mark@klomp.org>
+
+       * run-addrcfi.sh: Adjust expected rule for aarch64 sp.
+
 2018-04-03  Mark Wielaard  <mark@klomp.org>
 
        * testfileranges4.debug.bz2: New testfile.
index 376a6dc3109bca50901af5ee54449bf41c7f7826..fd89d025a3f64f4231b6c9c07828299a6d61be91 100755 (executable)
@@ -3637,7 +3637,7 @@ dwarf_cfi_addrframe (.eh_frame): no matching address range
        integer reg28 (x28): same_value
        integer reg29 (x29): same_value
        integer reg30 (x30): same_value
-       integer reg31 (sp): undefined
+       integer reg31 (sp): location expression: call_frame_cfa stack_value
        integer reg33 (elr): undefined
        FP/SIMD reg64 (v0): undefined
        FP/SIMD reg65 (v1): undefined