[lkml]   [2019]   [Sep]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 1/1] x86/purgatory: Change compiler flags to avoid relocation errors.
On Wed, Sep 4, 2019 at 10:34 PM Andreas Smas <> wrote:
> On Wed, Sep 4, 2019 at 3:19 PM Nick Desaulniers <> wrote:
> > Thanks for confirming the fix. While it sounds like -mcmodel=large is
> > the only necessary change, I don't object to -ffreestanding of
> > -fno-zero-initialized-in-bss being readded, especially since I think
> > what you've done with PURGATORY_CFLAGS_REMOVE is more concise.
> Without -ffreestanding this results in undefined symbols (as before this patch)

Thanks for the report and sorry for the breakage. Can you test
Steve's patch and send your tested by tag? Steve will likely respin
the final patch today with Boris' feedback, so now is the time to get
on the train.

> $ readelf -a arch/x86/purgatory/|grep UND
> 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND

^ what's that? A <strikethrough>horse</strikethrough> symbol with no name?

> 51: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND __stack_chk_fail

^ so I would have expected the stackprotector changes in my and Steve
commits to prevent compiler emission of that runtime-implemented
symbol. ie. that `-ffreestanding` affects that and not removing the
stackprotector flags begs another question. Without `-ffreestanding`
and `-fstack-protector` (or `-fstack-protector-strong`), why would the
compiler emit references to __stack_chk_fail? Which .o file that
composes the .ro file did we fail to remove the `-fstack-protector*`
flag from? `-ffreestanding` seems to be covering that up.

> I just bumped into this issue as I discovered that kexec() no longer works after
> the x86/purgatory: Use CFLAGS_REMOVE rather than reset KBUILD_CFLAGS -commit
> was merged.

~Nick Desaulniers

 \ /
  Last update: 2019-09-05 20:20    [W:0.102 / U:0.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site