Package: release.debian.org
Severity: normal
Tags: trixie
X-Debbugs-Cc: [email protected]
Control: affects -1 + src:gnu-efi
User: [email protected]
Usertags: pu

[ Reason ]
gnu-efi does not produce working UEFI binaries for armhf.
The details are in #1086705. This affects efibootguard but probably
other gnu-efi compiled binaries.

This stable update backports an upstream patch.

[ Impact ]
armhf-built EFI binaries, such as efibootguard's
/usr/lib/arm-linux-gnueabihf/efibootguard/efibootguardarm.efi
/usr/lib/arm-linux-gnueabihf/efibootguard/kernel-stubarm.efi
do not run, i.e. the armhf machine does not boot.

[ Tests ]
Two users have tested the backported patch with their armhf machines and
report it to work.

[ Risks ]
The patch only touches ARM 32 bit code, which is broken. The other archs
are not affected.

[ Checklist ]
  [x] *all* changes are documented in the d/changelog
  [x] I reviewed all changes and I approve them
  [x] attach debdiff against the package in stable
  [x] the issue is verified as fixed in unstable

[ Changes ]
The patch changes the handling of the _start symbol in 32 bit ARM assembly.

[ Other info ]
After this, a stable binNMU should run for the reverse build
dependencies if we have such a process. Otherwise I am going to file a
stable update for efibootguard after this is accepted.
diff -Nru gnu-efi-3.0.18/debian/changelog gnu-efi-3.0.18/debian/changelog
--- gnu-efi-3.0.18/debian/changelog     2024-03-25 20:50:29.000000000 +0100
+++ gnu-efi-3.0.18/debian/changelog     2026-01-07 23:10:37.000000000 +0100
@@ -1,3 +1,9 @@
+gnu-efi (3.0.18-1+deb13u1) trixie; urgency=medium
+
+  * Backport "ARM32: Split headers and code" (Closes: #1086705)
+
+ -- Bastian Germann <[email protected]>  Wed, 07 Jan 2026 23:10:37 +0100
+
 gnu-efi (3.0.18-1) unstable; urgency=medium
 
   * Strip LDFLAGS before passing to the build
diff -Nru gnu-efi-3.0.18/debian/patches/ARM32-Split-headers-and-code.patch 
gnu-efi-3.0.18/debian/patches/ARM32-Split-headers-and-code.patch
--- gnu-efi-3.0.18/debian/patches/ARM32-Split-headers-and-code.patch    
1970-01-01 01:00:00.000000000 +0100
+++ gnu-efi-3.0.18/debian/patches/ARM32-Split-headers-and-code.patch    
2026-01-07 23:09:32.000000000 +0100
@@ -0,0 +1,90 @@
+Origin: upstream, 24a4cd0e5653fd84b004c00c808c45cc3fb7a7e2
+From: Callum Farmer <[email protected]>
+Date: Mon, 23 Sep 2024 16:51:49 +0100
+Subject: ARM32: Split headers and code
+
+* Force code to be at known dest of 4096
+* Move _start into .text
+* Load the _start symbol address and then minus 4096 to get the load
+  address
+
+Signed-off-by: Callum Farmer <[email protected]>
+---
+ gnuefi/crt0-efi-arm.S  | 21 +++++++++++----------
+ gnuefi/elf_arm_efi.lds |  1 +
+ 2 files changed, 12 insertions(+), 10 deletions(-)
+
+diff --git a/gnuefi/crt0-efi-arm.S b/gnuefi/crt0-efi-arm.S
+index 9c2c467e..ad02ca10 100644
+--- a/gnuefi/crt0-efi-arm.S
++++ b/gnuefi/crt0-efi-arm.S
+@@ -45,11 +45,11 @@ optional_header:
+       .2byte  0x10b                           // PE32+ format
+       .byte   0x02                            // MajorLinkerVersion
+       .byte   0x14                            // MinorLinkerVersion
+-      .4byte  _etext - _start         // SizeOfCode
++      .4byte  _text_size - ImageBase          // SizeOfCode
+       .4byte  _alldata_size - ImageBase               // SizeOfInitializedData
+       .4byte  0                               // SizeOfUninitializedData
+-      .4byte  _start - ImageBase              // AddressOfEntryPoint
+-      .4byte  _start - ImageBase              // BaseOfCode
++      .4byte  _text - ImageBase               // AddressOfEntryPoint
++      .4byte  _text - ImageBase               // BaseOfCode
+       .4byte  _reloc - ImageBase              // BaseOfData
+ 
+ extra_header_fields:
+@@ -67,7 +67,7 @@ extra_header_fields:
+       .4byte  _image_end - ImageBase          // SizeOfImage
+ 
+       // Everything before the kernel image is considered part of the header
+-      .4byte  _start - ImageBase              // SizeOfHeaders
++      .4byte  _text - ImageBase               // SizeOfHeaders
+       .4byte  0                               // CheckSum
+       .2byte  EFI_SUBSYSTEM                   // Subsystem
+       .2byte  0                               // DllCharacteristics
+@@ -100,10 +100,10 @@ extra_header_fields:
+ section_table:
+ 
+       .ascii  ".text\0\0\0"
+-      .4byte  _evtext - _start // VirtualSize
+-      .4byte  _start - ImageBase      // VirtualAddress
+-      .4byte  _etext - _start         // SizeOfRawData
+-      .4byte  _start - ImageBase      // PointerToRawData
++      .4byte  _text_vsize - ImageBase // VirtualSize
++      .4byte  _text - ImageBase       // VirtualAddress
++      .4byte  _text_size - ImageBase          // SizeOfRawData
++      .4byte  _text - ImageBase       // PointerToRawData
+       .4byte  0               // PointerToRelocations (0 for executables)
+       .4byte  0               // PointerToLineNumbers (0 for executables)
+       .2byte  0               // NumberOfRelocations  (0 for executables)
+@@ -148,7 +148,7 @@ section_table:
+       .2byte  0                       // NumberOfLineNumbers
+       .4byte  0x40000040              // Characteristics (section flags)
+ 
+-.balign 256
++.text
+ .globl        _start
+ .type _start,%function
+ _start:
+@@ -159,7 +159,8 @@ _start:
+       adr             r1, .L_DYNAMIC
+       ldr             r0, [r1]
+       add             r1, r0, r1
+-      adr             r0, ImageBase
++      adr             r0, _start
++      sub             r0, r0, #0x1000
+       bl              _relocate
+       teq             r0, #0
+       bne             0f
+diff --git a/gnuefi/elf_arm_efi.lds b/gnuefi/elf_arm_efi.lds
+index afe17af3..b7e3fb13 100644
+--- a/gnuefi/elf_arm_efi.lds
++++ b/gnuefi/elf_arm_efi.lds
+@@ -5,6 +5,7 @@ SECTIONS
+ {
+   .text 0 : {
+     *(.text.head)
++    . = 0x1000;
+     _text = .;
+     *(.text)
+     *(.text.*)
diff -Nru gnu-efi-3.0.18/debian/patches/series 
gnu-efi-3.0.18/debian/patches/series
--- gnu-efi-3.0.18/debian/patches/series        1970-01-01 01:00:00.000000000 
+0100
+++ gnu-efi-3.0.18/debian/patches/series        2026-01-07 23:10:26.000000000 
+0100
@@ -0,0 +1 @@
+ARM32-Split-headers-and-code.patch

Reply via email to