[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200730205112.2099429-5-ndesaulniers@google.com>
Date: Thu, 30 Jul 2020 13:51:12 -0700
From: Nick Desaulniers <ndesaulniers@...gle.com>
To: Nathan Huckleberry <nhuck15@...il.com>,
Russell King <linux@...linux.org.uk>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Chunyan Zhang <zhang.lyra@...il.com>,
clang-built-linux@...glegroups.com,
Dmitry Safonov <0x7f454c46@...il.com>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-mediatek@...ts.infradead.org,
Lvqiang Huang <lvqiang.huang@...soc.com>,
Matthias Brugger <matthias.bgg@...il.com>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Miles Chen <miles.chen@...iatek.com>
Subject: [PATCH 4/4] ARM: backtrace: use more descriptive labels
We don't necessarily need the `b` suffixes used to disambiguate between
non-unique local labels. Give these labels more descriptive names.
Signed-off-by: Nick Desaulniers <ndesaulniers@...gle.com>
---
arch/arm/lib/backtrace.S | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/arch/arm/lib/backtrace.S b/arch/arm/lib/backtrace.S
index 872f658638d9..138e961ff033 100644
--- a/arch/arm/lib/backtrace.S
+++ b/arch/arm/lib/backtrace.S
@@ -37,9 +37,9 @@ ENDPROC(c_backtrace)
THUMB( orreq mask, #0x03 )
movne mask, #0 @ mask for 32-bit
-1: stmfd sp!, {pc} @ calculate offset of PC stored
+store_pc: stmfd sp!, {pc} @ calculate offset of PC stored
ldr r0, [sp], #4 @ by stmfd for this CPU
- adr r1, 1b
+ adr r1, store_pc
sub offset, r0, r1
/*
@@ -60,14 +60,14 @@ ENDPROC(c_backtrace)
for_each_frame: tst frame, mask @ Check for address exceptions
bne no_frame
-1001: ldr sv_pc, [frame, #0] @ get saved pc
-1002: ldr sv_fp, [frame, #-12] @ get saved fp
+load_pc: ldr sv_pc, [frame, #0] @ get saved pc
+load_fp: ldr sv_fp, [frame, #-12] @ get saved fp
sub sv_pc, sv_pc, offset @ Correct PC for prefetching
bic sv_pc, sv_pc, mask @ mask PC/LR for the mode
-1003: ldr r2, [sv_pc, #-4] @ if stmfd sp!, {args} exists,
- ldr r3, .Ldsi+4 @ adjust saved 'pc' back one
+load_stmfd: ldr r2, [sv_pc, #-4] @ if stmfd sp!, {args} exists,
+ ldr r3, .Lopcode + 4 @ adjust saved 'pc' back one
teq r3, r2, lsr #11 @ instruction
subne r0, sv_pc, #4 @ allow for mov
subeq r0, sv_pc, #8 @ allow for mov + stmia
@@ -79,15 +79,15 @@ for_each_frame: tst frame, mask @ Check for address exceptions
bl dump_backtrace_entry
ldr r1, [sv_pc, #-4] @ if stmfd sp!, {args} exists,
- ldr r3, .Ldsi+4
+ ldr r3, .Lopcode + 4
teq r3, r1, lsr #11
ldreq r0, [frame, #-8] @ get sp
subeq r0, r0, #4 @ point at the last arg
mov r2, loglvl
bleq dump_backtrace_stm @ dump saved registers
-1004: ldr r1, [sv_pc, #0] @ if stmfd sp!, {..., fp, ip, lr, pc}
- ldr r3, .Ldsi @ instruction exists,
+reload_stmfd: ldr r1, [sv_pc, #0] @ if stmfd sp!, {..., fp, ip, lr, pc}
+ ldr r3, .Lopcode @ instruction exists,
teq r3, r1, lsr #11
subeq r0, frame, #16
mov r2, loglvl
@@ -100,7 +100,7 @@ for_each_frame: tst frame, mask @ Check for address exceptions
mov frame, sv_fp @ above the current frame
bhi for_each_frame
-1006: adr r0, .Lbad
+bad_frame: adr r0, .Lbad
mov r1, loglvl
mov r2, frame
bl printk
@@ -109,15 +109,15 @@ ENDPROC(c_backtrace)
.pushsection __ex_table,"a"
.align 3
- .long 1001b, 1006b
- .long 1002b, 1006b
- .long 1003b, 1006b
- .long 1004b, 1006b
+ .long load_pc, bad_frame
+ .long load_fp, bad_frame
+ .long load_stmfd, bad_frame
+ .long reload_stmfd, bad_frame
.popsection
.Lbad: .asciz "%sBacktrace aborted due to bad frame pointer <%p>\n"
.align
-.Ldsi: .word 0xe92dd800 >> 11 @ stmfd sp!, {... fp, ip, lr, pc}
+.Lopcode: .word 0xe92dd800 >> 11 @ stmfd sp!, {... fp, ip, lr, pc}
.word 0xe92d0000 >> 11 @ stmfd sp!, {}
#endif
--
2.28.0.163.g6104cc2f0b6-goog
Powered by blists - more mailing lists