________________________________________
From: Nick Desaulniers <ndesau...@google.com>
Sent: 25 September 2019 17:35
To: Borislav Petkov
Cc: H. Peter Anvin; Jarkko Sakkinen; Thomas Gleixner; Ingo Molnar; clang-built-linux; maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT); Tri Vo; Masahiro Yamada; Rob Herring; George Rimar; LKML; Fangrui Song; Peter Smith; Rui Ueyama
Subject: Re: [PATCH v2] x86, realmode: explicitly set entry via command line
SECTIONS
{
--
Thanks,
~Nick Desaulniers
If I've understood the thread correctly, sorry jumping in late.
- LLD will set the entry point to the start of the .text section in absence of any of the other ways to communicate an entry point. It gives a warning in this case.
- Setting the entry point to an address that is the current start of the .text section silences the warning, but is potentially fragile.
I think LLD is on balance right to give a warning as in many cases the start of the .text section is not going to coincide with the desired entry point.
I recommend doing this via using a symbol defined at the entry point, for example Nick's last suggestion. This will be most resistant to changes such as the .text section changing address or the entry point isn't first in the .text section.
Peter