Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <gang.chen.5i5j@gmail.com>
Acked-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>

authored by

Chen Gang and committed by
Michal Marek
9df62f05 e36aaea2

+14 -7
+2
arch/arc/include/asm/linkage.h
··· 11 11 12 12 #ifdef __ASSEMBLY__ 13 13 14 + #define ASM_NL ` /* use '`' to mark new line in macro */ 15 + 14 16 /* Can't use the ENTRY macro in linux/linkage.h 15 17 * gas considers ';' as comment vs. newline 16 18 */
+12 -7
include/linux/linkage.h
··· 6 6 #include <linux/export.h> 7 7 #include <asm/linkage.h> 8 8 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 + 9 14 #ifdef __cplusplus 10 15 #define CPP_ASMLINKAGE extern "C" 11 16 #else ··· 80 75 81 76 #ifndef ENTRY 82 77 #define ENTRY(name) \ 83 - .globl name; \ 84 - ALIGN; \ 85 - name: 78 + .globl name ASM_NL \ 79 + ALIGN ASM_NL \ 80 + name: 86 81 #endif 87 82 #endif /* LINKER_SCRIPT */ 88 83 89 84 #ifndef WEAK 90 85 #define WEAK(name) \ 91 - .weak name; \ 86 + .weak name ASM_NL \ 92 87 name: 93 88 #endif 94 89 95 90 #ifndef END 96 91 #define END(name) \ 97 - .size name, .-name 92 + .size name, .-name 98 93 #endif 99 94 100 95 /* If symbol 'name' is treated as a subroutine (gets called, and returns) ··· 103 98 */ 104 99 #ifndef ENDPROC 105 100 #define ENDPROC(name) \ 106 - .type name, @function; \ 107 - END(name) 101 + .type name, @function ASM_NL \ 102 + END(name) 108 103 #endif 109 104 110 105 #endif