* [PATCH] x86: define _end in the EFI linker scripts
@ 2026-12-01 9:09 Alexander Shiyan
2026-12-01 9:26 ` Alexander Shiyan
0 siblings, 1 reply; 2+ messages in thread
From: Alexander Shiyan @ 2026-12-01 9:09 UTC (permalink / raw)
To: barebox; +Cc: Alexander Shiyan
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
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] x86: define _end in the EFI linker scripts
2026-12-01 9:09 [PATCH] x86: define _end in the EFI linker scripts Alexander Shiyan
@ 2026-12-01 9:26 ` Alexander Shiyan
0 siblings, 0 replies; 2+ messages in thread
From: Alexander Shiyan @ 2026-12-01 9:26 UTC (permalink / raw)
To: barebox
Please drop this one.
вт, 1 дек. 2026 г. в 12:09, Alexander Shiyan <eagle.alexander923@gmail.com>:
>
> 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
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-12-01 10:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-01 9:09 [PATCH] x86: define _end in the EFI linker scripts Alexander Shiyan
2026-12-01 9:26 ` Alexander Shiyan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox