Skip to content

Commit fa3eb71

Browse files
Dave Martinwildea01
authored andcommitted
arm64: asm-bug: Renumber macro local labels to avoid clashes
Currently ASM_BUG() and its constituent macros define local assembler labels 0, 1 and 2 internally, which carries a high risk of clash with callers' labels and consequent mis-assembly. This patch gives the labels a big random offset to minimise the chance of such errors. Signed-off-by: Dave Martin <Dave.Martin@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
1 parent 6436bee commit fa3eb71

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎arch/arm64/include/asm/asm-bug.h‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
#define _BUGVERBOSE_LOCATION(file, line) __BUGVERBOSE_LOCATION(file, line)
2323
#define __BUGVERBOSE_LOCATION(file, line) \
2424
.pushsection .rodata.str,"aMS",@progbits,1; \
25-
2: .string file; \
25+
14472: .string file; \
2626
.popsection; \
2727
\
28-
.long 2b - 0b; \
28+
.long 14472b - 14470b; \
2929
.short line;
3030
#else
3131
#define _BUGVERBOSE_LOCATION(file, line)
@@ -36,11 +36,11 @@
3636
#define __BUG_ENTRY(flags) \
3737
.pushsection __bug_table,"aw"; \
3838
.align 2; \
39-
0: .long 1f - 0b; \
39+
14470: .long 14471f - 14470b; \
4040
_BUGVERBOSE_LOCATION(__FILE__, __LINE__) \
4141
.short flags; \
4242
.popsection; \
43-
1:
43+
14471:
4444
#else
4545
#define __BUG_ENTRY(flags)
4646
#endif

0 commit comments

Comments
 (0)