[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKwvOdnesgP8uVv3x9Ywqy0U24d_V9G-ovD5y__xJKB+t==6hg@mail.gmail.com>
Date: Tue, 24 Sep 2019 12:37:30 -0700
From: Nick Desaulniers <ndesaulniers@...gle.com>
To: Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>
Cc: clang-built-linux <clang-built-linux@...glegroups.com>,
"H. Peter Anvin" <hpa@...or.com>,
"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@...nel.org>,
Tri Vo <trong@...roid.com>,
Masahiro Yamada <yamada.masahiro@...ionext.com>,
Rob Herring <robh@...nel.org>,
George Rimar <grimar@...esssoftek.com>,
LKML <linux-kernel@...r.kernel.org>,
Sedat Dilek <sedat.dilek@...il.com>
Subject: Re: [PATCH v2] x86, realmode: explicitly set entry via command line
On Tue, Sep 24, 2019 at 12:33 PM Nick Desaulniers
<ndesaulniers@...gle.com> wrote:
>
> 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.
>
> Link: https://github.com/ClangBuiltLinux/linux/issues/216
> Signed-off-by: Nick Desaulniers <ndesaulniers@...gle.com>
I meant to pick up Sedat's reported by tag:
Reported-by: Sedat Dilek <sedat.dilek@...il.com>
> ---
> Changes V1 -> V2:
> * Use command line flag, rather than linker script, as ld.bfd produces a
> syntax error for `ENTRY(0x1000)` but is happy with `-e 0x1000`
>
> arch/x86/realmode/rm/Makefile | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/realmode/rm/Makefile b/arch/x86/realmode/rm/Makefile
> index f60501a384f9..338a00c5257f 100644
> --- a/arch/x86/realmode/rm/Makefile
> +++ b/arch/x86/realmode/rm/Makefile
> @@ -46,7 +46,7 @@ $(obj)/pasyms.h: $(REALMODE_OBJS) FORCE
> targets += realmode.lds
> $(obj)/realmode.lds: $(obj)/pasyms.h
>
> -LDFLAGS_realmode.elf := -m elf_i386 --emit-relocs -T
> +LDFLAGS_realmode.elf := -m elf_i386 --emit-relocs -e 0x1000 -T
> CPPFLAGS_realmode.lds += -P -C -I$(objtree)/$(obj)
>
> targets += realmode.elf
> --
> 2.23.0.351.gc4317032e6-goog
>
--
Thanks,
~Nick Desaulniers
Powered by blists - more mailing lists