mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Alexander Shiyan <eagle.alexander923@gmail.com>
To: barebox@lists.infradead.org
Cc: Alexander Shiyan <eagle.alexander923@gmail.com>
Subject: [PATCH] x86: define _end in the EFI linker scripts
Date: Tue,  1 Dec 2026 12:09:11 +0300	[thread overview]
Message-ID: <20261201090911.125085-1-eagle.alexander923@gmail.com> (raw)

common/kallsyms.c uses _end as the fallback symbol end for the last
symbol in the kallsyms table, and the X86 architecture selects
HAS_KALLSYMS unconditionally. The x86 EFI linker scripts, however, only
define __bss_stop and _edata, so any x86_64 build with CONFIG_KALLSYMS
enabled fails to link:

  ld: common/kallsyms.o: in function `get_symbol_pos':
  kallsyms.c:(.text+0x1e6): undefined reference to `_end'

The other architectures all end their linker script with _end, so add it
to both the 64-bit and the 32-bit EFI script for consistency.

Fixes: d44fdb7d9b85 ("x86: drop legacy (PC BIOS) boot in favor of EFI")
Signed-off-by: Alexander Shiyan <eagle.alexander923@gmail.com>
---
 arch/x86/mach-efi/elf_ia32_efi.lds.S   | 1 +
 arch/x86/mach-efi/elf_x86_64_efi.lds.S | 1 +
 2 files changed, 2 insertions(+)

diff --git a/arch/x86/mach-efi/elf_ia32_efi.lds.S b/arch/x86/mach-efi/elf_ia32_efi.lds.S
index 0a3b6ef947..6f7dc3f551 100644
--- a/arch/x86/mach-efi/elf_ia32_efi.lds.S
+++ b/arch/x86/mach-efi/elf_ia32_efi.lds.S
@@ -88,4 +88,5 @@ SECTIONS
 	}
 
 	.comment 0 : { *(.comment) }
+	_end = .;
 }
diff --git a/arch/x86/mach-efi/elf_x86_64_efi.lds.S b/arch/x86/mach-efi/elf_x86_64_efi.lds.S
index ed2ddd5248..fde296e571 100644
--- a/arch/x86/mach-efi/elf_x86_64_efi.lds.S
+++ b/arch/x86/mach-efi/elf_x86_64_efi.lds.S
@@ -82,4 +82,5 @@ SECTIONS
 	}
 
 	.comment 0 : { *(.comment) }
+	_end = .;
 }
-- 
2.54.0




             reply	other threads:[~2026-12-01 10:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-01  9:09 Alexander Shiyan [this message]
2026-12-01  9:26 ` [PATCH] x86: define _end in the EFI linker scripts Alexander Shiyan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261201090911.125085-1-eagle.alexander923@gmail.com \
    --to=eagle.alexander923@gmail.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox