Skip to content

Commit 9df62f0

Browse files
Chen-Gangmichal42
authored andcommitted
arch: use ASM_NL instead of ';' for assembler new line character in the macro
For some assemblers, they use another character as newline in a macro (e.g. arc uses '`'), so for generic assembly code, need use ASM_NL (a macro) instead of ';' for it. Signed-off-by: Chen Gang <[email protected]> Acked-by: Vineet Gupta <[email protected]> Signed-off-by: Michal Marek <[email protected]>
1 parent e36aaea commit 9df62f0

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

arch/arc/include/asm/linkage.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
#ifdef __ASSEMBLY__
1313

14+
#define ASM_NL ` /* use '`' to mark new line in macro */
15+
1416
/* Can't use the ENTRY macro in linux/linkage.h
1517
* gas considers ';' as comment vs. newline
1618
*/

include/linux/linkage.h

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
#include <linux/export.h>
77
#include <asm/linkage.h>
88

9+
/* Some toolchains use other characters (e.g. '`') to mark new line in macro */
10+
#ifndef ASM_NL
11+
#define ASM_NL ;
12+
#endif
13+
914
#ifdef __cplusplus
1015
#define CPP_ASMLINKAGE extern "C"
1116
#else
@@ -75,21 +80,21 @@
7580

7681
#ifndef ENTRY
7782
#define ENTRY(name) \
78-
.globl name; \
79-
ALIGN; \
80-
name:
83+
.globl name ASM_NL \
84+
ALIGN ASM_NL \
85+
name:
8186
#endif
8287
#endif /* LINKER_SCRIPT */
8388

8489
#ifndef WEAK
8590
#define WEAK(name) \
86-
.weak name; \
91+
.weak name ASM_NL \
8792
name:
8893
#endif
8994

9095
#ifndef END
9196
#define END(name) \
92-
.size name, .-name
97+
.size name, .-name
9398
#endif
9499

95100
/* If symbol 'name' is treated as a subroutine (gets called, and returns)
@@ -98,8 +103,8 @@
98103
*/
99104
#ifndef ENDPROC
100105
#define ENDPROC(name) \
101-
.type name, @function; \
102-
END(name)
106+
.type name, @function ASM_NL \
107+
END(name)
103108
#endif
104109

105110
#endif

0 commit comments

Comments
 (0)