1 From 8dabc6eab444607a68d710f0b09942277095e219 Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.com>
3 Date: Wed, 12 Jan 2022 17:27:03 +0000
4 Subject: [PATCH] arm: Fix annoying .eh_frame section warnings
6 Replace the cfi directives with the UNWIND equivalents. This prevents
7 the .eh_frame section from being created, eliminating the warnings.
9 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
11 arch/arm/lib/memcpy_rpi.S | 2 ++
12 arch/arm/lib/memcpymove.h | 45 ++++++++++++--------------------------
13 arch/arm/lib/memmove_rpi.S | 2 ++
14 3 files changed, 18 insertions(+), 31 deletions(-)
16 --- a/arch/arm/lib/memcpy_rpi.S
17 +++ b/arch/arm/lib/memcpy_rpi.S
18 @@ -27,6 +27,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBI
21 #include <linux/linkage.h>
22 +#include <asm/assembler.h>
23 +#include <asm/unwind.h>
25 #include "memcpymove.h"
27 --- a/arch/arm/lib/memcpymove.h
28 +++ b/arch/arm/lib/memcpymove.h
29 @@ -280,6 +280,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBI
31 pop {DAT3, DAT4, DAT5, DAT6, DAT7}
32 pop {D, DAT1, DAT2, pc}
36 .macro memcpy_medium_inner_loop backwards, align
37 @@ -358,19 +359,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBI
44 push {D, DAT1, DAT2, lr}
47 - .cfi_def_cfa_offset 16
48 - .cfi_rel_offset D, 0
52 - .cfi_rel_offset DAT1, 4
53 - .cfi_rel_offset DAT2, 8
55 - .cfi_rel_offset lr, 12
57 + UNWIND( .save {D, DAT1, DAT2, lr} )
61 @@ -386,17 +381,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBI
64 push {DAT3, DAT4, DAT5, DAT6, DAT7}
67 - .cfi_def_cfa_offset 36
68 - .cfi_rel_offset D, 20
69 - .cfi_rel_offset DAT1, 24
70 - .cfi_rel_offset DAT2, 28
71 - .cfi_rel_offset DAT3, 0
72 - .cfi_rel_offset DAT4, 4
73 - .cfi_rel_offset DAT5, 8
74 - .cfi_rel_offset DAT6, 12
75 - .cfi_rel_offset DAT7, 16
76 - .cfi_rel_offset lr, 32
78 + UNWIND( .save {D, DAT1, DAT2, lr} )
79 + UNWIND( .save {DAT3, DAT4, DAT5, DAT6, DAT7} )
81 /* Adjust N so that the decrement instruction can also test for
82 * inner loop termination. We want it to stop when there are
83 @@ -436,16 +425,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBI
84 156: memcpy_long_inner_loop backwards, 2
85 157: memcpy_long_inner_loop backwards, 3
87 - .cfi_def_cfa_offset 16
88 - .cfi_rel_offset D, 0
89 - .cfi_rel_offset DAT1, 4
90 - .cfi_rel_offset DAT2, 8
91 - .cfi_same_value DAT3
92 - .cfi_same_value DAT4
93 - .cfi_same_value DAT5
94 - .cfi_same_value DAT6
95 - .cfi_same_value DAT7
96 - .cfi_rel_offset lr, 12
100 + UNWIND( .save {D, DAT1, DAT2, lr} )
102 160: /* Medium case */
103 preload_all backwards, 0, 0, S, N, DAT2, OFF
104 @@ -488,7 +471,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBI
105 memcpy_short_inner_loop backwards, 0
106 140: memcpy_short_inner_loop backwards, 1
113 --- a/arch/arm/lib/memmove_rpi.S
114 +++ b/arch/arm/lib/memmove_rpi.S
115 @@ -27,6 +27,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBI
118 #include <linux/linkage.h>
119 +#include <asm/assembler.h>
120 +#include <asm/unwind.h>
122 #include "memcpymove.h"