Skip to content
This repository was archived by the owner on Nov 21, 2022. It is now read-only.

Commit 7ff79fc

Browse files
nickdesaulniersnathanchance
authored andcommitted
x86/realmode: Explicitly set entry point via ENTRY in linker script
Linking with ld.lld via $ make LD=ld.lld produces the warning: ld.lld: warning: cannot find entry symbol _start; defaulting to 0x1000 Linking with ld.bfd shows the default entry is 0x1000: $ readelf -h arch/x86/realmode/rm/realmode.elf | grep Entry Entry point address: 0x1000 While ld.lld is being pedantic, just set the entry point explicitly, instead of depending on the implicit default. The symbol pa_text_start refers to the start of the .text section, which may not be at 0x1000 if the preceding sections listed in arch/x86/realmode/rm/realmode.lds.S were large enough. This matches behavior in arch/x86/boot/setup.ld. Reported-by: Sedat Dilek <[email protected]> Suggested-by: Borislav Petkov <[email protected]> Suggested-by: Peter Smith <[email protected]> Signed-off-by: Nick Desaulniers <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Cc: "H. Peter Anvin" <[email protected]> Cc: [email protected] Cc: [email protected] Cc: Ingo Molnar <[email protected]> Cc: [email protected] Cc: [email protected] Cc: Thomas Gleixner <[email protected]> Cc: x86-ml <[email protected]> Link: https://lkml.kernel.org/r/[email protected] Link: ClangBuiltLinux/linux#216 (cherry picked from commit 6a181e3) Signed-off-by: Nathan Chancellor <[email protected]>
1 parent cfd70f0 commit 7ff79fc

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

arch/x86/realmode/rm/realmode.lds.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
1313
OUTPUT_ARCH(i386)
14+
ENTRY(pa_text_start)
1415

1516
SECTIONS
1617
{

0 commit comments

Comments
 (0)