bcm27xx: add support for linux v5.15
[openwrt/staging/chunkeey.git] / target / linux / bcm27xx / patches-5.15 / 950-0653-arm-Fix-annoying-.eh_frame-section-warnings.patch
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
5
6 Replace the cfi directives with the UNWIND equivalents. This prevents
7 the .eh_frame section from being created, eliminating the warnings.
8
9 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
10 ---
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(-)
15
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
19 */
20
21 #include <linux/linkage.h>
22 +#include <asm/assembler.h>
23 +#include <asm/unwind.h>
24 #include "arm-mem.h"
25 #include "memcpymove.h"
26
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
30 199:
31 pop {DAT3, DAT4, DAT5, DAT6, DAT7}
32 pop {D, DAT1, DAT2, pc}
33 + UNWIND( .fnend )
34 .endm
35
36 .macro memcpy_medium_inner_loop backwards, align
37 @@ -358,19 +359,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBI
38 LAST .req ip
39 OFF .req lr
40
41 - .cfi_startproc
42 + UNWIND( .fnstart )
43
44 push {D, DAT1, DAT2, lr}
45 + UNWIND( .fnend )
46
47 - .cfi_def_cfa_offset 16
48 - .cfi_rel_offset D, 0
49 - .cfi_undefined S
50 - .cfi_undefined N
51 - .cfi_undefined DAT0
52 - .cfi_rel_offset DAT1, 4
53 - .cfi_rel_offset DAT2, 8
54 - .cfi_undefined LAST
55 - .cfi_rel_offset lr, 12
56 + UNWIND( .fnstart )
57 + UNWIND( .save {D, DAT1, DAT2, lr} )
58
59 .if backwards
60 add D, D, N
61 @@ -386,17 +381,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBI
62
63 /* Long case */
64 push {DAT3, DAT4, DAT5, DAT6, DAT7}
65 + UNWIND( .fnend )
66
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
77 + UNWIND( .fnstart )
78 + UNWIND( .save {D, DAT1, DAT2, lr} )
79 + UNWIND( .save {DAT3, DAT4, DAT5, DAT6, DAT7} )
80
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
86
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
97 + UNWIND( .fnend )
98 +
99 + UNWIND( .fnstart )
100 + UNWIND( .save {D, DAT1, DAT2, lr} )
101
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
107
108 - .cfi_endproc
109 + UNWIND( .fnend )
110
111 .unreq D
112 .unreq S
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
116 */
117
118 #include <linux/linkage.h>
119 +#include <asm/assembler.h>
120 +#include <asm/unwind.h>
121 #include "arm-mem.h"
122 #include "memcpymove.h"
123