]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[build] Use .balign directive instead of .align
authorMichael Brown <mcb30@ipxe.org>
Fri, 12 Feb 2021 23:22:54 +0000 (23:22 +0000)
committerMichael Brown <mcb30@ipxe.org>
Fri, 12 Feb 2021 23:22:54 +0000 (23:22 +0000)
The semantics of the assembler's .align directive vary by CPU
architecture.  For the ARM builds, it specifies a power of two rather
than a number of bytes.  This currently leads to the .einfo entries
(which do not appear in the final binary) having an alignment of 256
bytes for the ARM builds.

Fix by switching to the GNU-specific directive .balign, which is
consistent across architectures

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/arch/x86/core/stack.S
src/arch/x86/core/stack16.S
src/arch/x86/interface/pcbios/e820mangler.S
src/arch/x86/interface/pxe/pxe_entry.S
src/arch/x86/prefix/exeprefix.S
src/arch/x86/prefix/mromprefix.S
src/arch/x86/prefix/romprefix.S
src/arch/x86/prefix/unlzma.S
src/arch/x86/transitions/liba20.S
src/arch/x86/transitions/librm.S
src/include/errno.h

index 995c397cad1e609f490eb51a1db16e41c2d8c270..baa19ff8431b182d92f04ed705c0a44bfb5d04a1 100644 (file)
@@ -13,7 +13,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
  ****************************************************************************
  */
        .section ".stack", "aw", @nobits
-       .align 8
+       .balign 8
        .globl _stack
 _stack:
        .space STACK_SIZE
index 4bc6f081a94dcd424a51ad887826cfc6e9464d68..ad67e4f2d17e93da2e48b1e3b011b3d8062dd0e3 100644 (file)
@@ -7,7 +7,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
  ****************************************************************************
  */
        .section ".stack16", "aw", @nobits
-       .align 8
+       .balign 8
        .globl _stack16
 _stack16:
        .space 4096
index d5d97b482e547983cc9b75d2613ba1f5004ddea2..296a6488bb3e94c9f97e32bbfb7dd34404bed5b7 100644 (file)
@@ -67,7 +67,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
  ****************************************************************************
  */
        .section ".data16", "aw", @progbits
-       .align 16
+       .balign 16
        .globl hidemem_base
        .globl hidemem_umalloc
        .globl hidemem_textdata
index 663aa842e06932ae7bcf3dc5c2e0677a182eccda..3a5a100e33bcbaff89d11b58384ce5f99fa78628 100644 (file)
@@ -34,7 +34,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
  */
        .section ".text16.data", "aw", @progbits
        .globl ppxe
-       .align 16
+       .balign 16
 ppxe:
        .ascii "!PXE"                   /* Signature */
        .byte pxe_length                /* StructLength */
@@ -72,7 +72,7 @@ undiheader:
  */
        .section ".text16.data", "aw", @progbits
        .globl pxenv
-       .align 16
+       .balign 16
 pxenv:
        .ascii "PXENV+"                 /* Signature */
        .word 0x0201                    /* Version */
index c351456e2ebedba7eb5a024e2fbf6c32c4a98a47..0eab8c12ae5d11a322147a8b6690d8c50d93b177 100644 (file)
@@ -110,7 +110,7 @@ overlay:
        /* Overlay number */
        .word   0
 
-       .align 16, 0
+       .balign 16, 0
 
        .globl  _exe_start
 _exe_start:
index 2b5c6bf64825c265bdfce7f0ca30827c57b49c7b..d08284d7a84ad7ff120f01bde15ba5cb6832a68f 100644 (file)
@@ -492,7 +492,7 @@ mromheader:
        .word   0
        .size   mromheader, . - mromheader
 
-       .align  4
+       .balign 4
 mpciheader:
        .ascii  "PCIR"                  /* Signature */
        .word   pci_vendor_id           /* Vendor identification */
index 3abef0eaf734f45303b9ca61f91e610b08b1d431..a9934a7259b87c7b7f275f1649784d86986c657c 100644 (file)
@@ -88,7 +88,7 @@ checksum:
        .previous
 
 .ifeqs BUSTYPE, "PCIR"
-       .align  4
+       .balign 4
 pciheader:
        .ascii  "PCIR"                  /* Signature */
        .word   pci_vendor_id           /* Vendor identification */ 
@@ -136,7 +136,7 @@ pci_devlist_end:
         * BIOSes will scan on 16-byte boundaries rather than using
         * the offset stored at 0x1a
         */
-       .align  16
+       .balign 16
 pnpheader:
        .ascii  "$PnP"                  /* Signature */
        .byte   0x01                    /* Structure revision */
@@ -184,7 +184,7 @@ prodstr_pci_id:
 
        .globl  undiheader      
        .weak   undiloader
-       .align  4
+       .balign 4
 undiheader:
        .ascii  "UNDI"                  /* Signature */
        .byte   undiheader_len          /* Length of structure */
@@ -199,7 +199,7 @@ undiheader:
        .equ undiheader_len, . - undiheader
        .size undiheader, . - undiheader
 
-       .align  4
+       .balign 4
 ipxeheader:
        .ascii  "iPXE"                  /* Signature */
        .byte   ipxeheader_len          /* Length of structure */
index ce18c756fa655cf03bab8be78166eca307429c6e..956eeb24cd9852c94bb5f35c016376ba2fe9f6f8 100644 (file)
@@ -231,7 +231,7 @@ rep_len_dec:        .space  sizeof__lzma_len_dec
 literal:       .rept   ( ( 1 << LZMA_LC ) * 0x300 )
                .word   0
                .endr
-       .align  4
+       .balign 4
        .equ    sizeof__lzma_dec, . - lzma_dec
        .previous
 
index 6c1e1f62fb8e72cde63f9ec9a2857c5084c56289..57603353e8d8f2e17954ea0d7a54b863d2b9c657 100644 (file)
@@ -285,7 +285,7 @@ enable_a20:
        ret
 
        .section ".text16.early.data", "aw", @progbits
-       .align  2
+       .balign 2
 enable_a20_method:
        .word   0
        .size   enable_a20_method, . - enable_a20_method
index 9d3eff954e39b47d1ea088e4733bbd54708b7287..f2fa8c50b15f2ad83df6f2d191a3127d693aff6d 100644 (file)
@@ -99,7 +99,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
  ****************************************************************************
  */
        .section ".data16.gdt", "aw", @progbits
-       .align 16
+       .balign 16
 gdt:
 gdtr:          /* The first GDT entry is unused, the GDTR can fit here. */
 gdt_limit:             .word gdt_length - 1
@@ -224,7 +224,7 @@ RC_TMP_END:
 
        /* Shared temporary static buffer */
        .section ".bss16.rm_tmpbuf", "aw", @nobits
-       .align 16
+       .balign 16
 rm_tmpbuf:
        .space  VC_TMP_END
        .size   rm_tmpbuf, . - rm_tmpbuf
@@ -1470,7 +1470,7 @@ interrupt_wrapper:
  ****************************************************************************
  */
        .section ".pages", "aw", @nobits
-       .align  SIZEOF_PT
+       .balign SIZEOF_PT
 
        /* Page map level 4 entries (PML4Es)
         *
index 342384fa433e62f9d1c7bae001c7333266d01992..decde38edcadba329e2b44cf5203d7e55cca3998 100644 (file)
@@ -259,7 +259,7 @@ static inline void eplatform_discard ( int dummy __unused, ... ) {}
  */
 #define __einfo_error( einfo ) ( {                                     \
        __asm__ ( ".section \".einfo\", \"\", " PROGBITS_OPS "\n\t"     \
-                 ".align 8\n\t"                                        \
+                 ".balign 8\n\t"                                       \
                  "\n1:\n\t"                                            \
                  ".long ( 4f - 1b )\n\t"                               \
                  ".long %c0\n\t"                                       \
@@ -268,7 +268,7 @@ static inline void eplatform_discard ( int dummy __unused, ... ) {}
                  ".long %c1\n\t"                                       \
                  "\n2:\t.asciz \"" __einfo_desc ( einfo ) "\"\n\t"     \
                  "\n3:\t.asciz \"" __FILE__ "\"\n\t"                   \
-                 ".align 8\n\t"                                        \
+                 ".balign 8\n\t"                                       \
                  "\n4:\n\t"                                            \
                  ".previous\n\t" : :                                   \
                  "i" ( __einfo_errno ( einfo ) ),                      \