efi_selftest: allow building on ARMv7-M
[oweals/u-boot.git] / arch / arm / lib / crt0_arm_efi.S
index af55bba4baa0eb533a3982d7109ec9301283610d..5470e2ff0e68c577ff991031b9f9c31f4603041a 100644 (file)
@@ -1,10 +1,9 @@
+/* SPDX-License-Identifier: GPL-2.0+ OR BSD-2-Clause */
 /*
  * crt0-efi-arm.S - PE/COFF header for ARM EFI applications
  *
  * Copright (C) 2014 Linaro Ltd. <ard.biesheuvel@linaro.org>
  *
- * SPDX-License-Identifier:     GPL-2.0+     BSD-2-Clause
- *
  * This file is taken and modified from the gnu-efi project.
  */
 
@@ -28,16 +27,16 @@ coff_header:
        .short  2                               /* nr_sections */
        .long   0                               /* TimeDateStamp */
        .long   0                               /* PointerToSymbolTable */
-       .long   1                               /* NumberOfSymbols */
+       .long   0                               /* NumberOfSymbols */
        .short  section_table - optional_header /* SizeOfOptionalHeader */
-       /*
-        * Characteristics: IMAGE_FILE_32BIT_MACHINE |
-        * IMAGE_FILE_DEBUG_STRIPPED | IMAGE_FILE_EXECUTABLE_IMAGE |
-        * IMAGE_FILE_LINE_NUMS_STRIPPED
-        */
-       .short  0x306
+       /* Characteristics */
+       .short  (IMAGE_FILE_EXECUTABLE_IMAGE | \
+                IMAGE_FILE_LINE_NUMS_STRIPPED | \
+                IMAGE_FILE_LOCAL_SYMS_STRIPPED | \
+                IMAGE_FILE_32BIT_MACHINE | \
+                IMAGE_FILE_DEBUG_STRIPPED)
 optional_header:
-       .short  0x10b                           /* PE32+ format */
+       .short  0x10b                           /* PE32 format */
        .byte   0x02                            /* MajorLinkerVersion */
        .byte   0x14                            /* MinorLinkerVersion */
        .long   _edata - _start                 /* SizeOfCode */
@@ -120,8 +119,6 @@ section_table:
 _start:
        stmfd           sp!, {r0-r2, lr}
 
-       mov             r2, r0
-       mov             r3, r1
        adr             r1, .L_DYNAMIC
        ldr             r0, [r1]
        add             r1, r0, r1