Skip to content

Commit aeed41a

Browse files
Marc Zyngierctmarinas
authored andcommitted
arm64: fix alignment padding in assembly code
An interesting effect of using the generic version of linkage.h is that the padding is defined in terms of x86 NOPs, which can have even more interesting effects when the assembly code looks like this: ENTRY(func1) mov x0, xzr ENDPROC(func1) // fall through ENTRY(func2) mov x0, #1 ret ENDPROC(func2) Admittedly, the code is not very nice. But having code from another architecture doesn't look completely sane either. The fix is to add arm64's version of linkage.h, which causes the insertion of proper AArch64 NOPs. Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
1 parent 8f34a1d commit aeed41a

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

arch/arm64/include/asm/Kbuild

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ generic-y += ipcbuf.h
1818
generic-y += irq_regs.h
1919
generic-y += kdebug.h
2020
generic-y += kmap_types.h
21-
generic-y += linkage.h
2221
generic-y += local.h
2322
generic-y += local64.h
2423
generic-y += mman.h

arch/arm64/include/asm/linkage.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#ifndef __ASM_LINKAGE_H
2+
#define __ASM_LINKAGE_H
3+
4+
#define __ALIGN .align 4
5+
#define __ALIGN_STR ".align 4"
6+
7+
#endif

0 commit comments

Comments
 (0)