]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPkg/AsmMacroIoLib: force word alignment for functions
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Tue, 13 Sep 2016 17:25:14 +0000 (18:25 +0100)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Wed, 21 Sep 2016 07:53:24 +0000 (08:53 +0100)
Without an explicit .align directive, the Clang assembler defaults to
no alignment, which may result in instructions appearing misaligned in
the final executable. So use word alignment in all cases.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
ArmPkg/Include/AsmMacroIoLib.h

index fb73ea9a46945b1f743a4b1d99999988a78b553c..936e01e3388f2020501b0fc3209409682cf92162 100644 (file)
@@ -56,6 +56,7 @@
   .global   Name                  ; \\r
   .section  #Section, "ax"        ; \\r
   .type     Name, %function       ; \\r
   .global   Name                  ; \\r
   .section  #Section, "ax"        ; \\r
   .type     Name, %function       ; \\r
+  .p2align  2                     ; \\r
   Name:\r
 \r
 #define ASM_FUNC(Name)            _ASM_FUNC(ASM_PFX(Name), .text. ## Name)\r
   Name:\r
 \r
 #define ASM_FUNC(Name)            _ASM_FUNC(ASM_PFX(Name), .text. ## Name)\r