On Thu, Jan 02, 2020 at 06:03:48PM +0100, Ard Biesheuvel wrote: > On Thu, 2 Jan 2020 at 17:59, Arvind Sankar <nivedita@xxxxxxxxxxxx> wrote: > > > > On Thu, Jan 02, 2020 at 05:28:16PM +0100, Ard Biesheuvel wrote: > > > On Thu, 2 Jan 2020 at 16:58, Ard Biesheuvel <ard.biesheuvel@xxxxxxxxxx> wrote: > > > > > > > > On Thu, 2 Jan 2020 at 16:51, Arvind Sankar <nivedita@xxxxxxxxxxxx> wrote: > > > > > > > > > > On Thu, Jan 02, 2020 at 04:20:46PM +0100, Ard Biesheuvel wrote: > > > > > > > > > > > > Yeah, good point. > > > > > > > > > > > > I pushed as branch here; > > > > > > https://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git/log/?h=efi-libstub-attr-const > > > > > > > > > > > > Could you please check if that fixes the issue for efi_is_64bit() ? > > > > > > > > > > Haven't built it yet -- but how does this handle the GOT issues you > > > > > mentioned? > > > > > > > > It doesn't. The trick is to add __attribute__((visibility("hidden"))) > > > > to the extern declaration of efi_is64, but I am having trouble to > > > > reproduce the original issue. > > > > > > Some background: > > > > > > https://lore.kernel.org/lkml/5405E186.2080406@xxxxxxxxxxxxx/ > > > https://lore.kernel.org/lkml/20140919104021.GA11552@xxxxxxxxx/ > > > > I wonder if commit 6d92bc9d483a ("x86/build: Build compressed x86 > > kernels as PIE") resolved this. > > Good question. But note that the stub is still built with -fPIC not -fPIE. Hm libstub is -fPIC but arch/x86/boot/compressed is -fPIE. With -fPIE gcc 5+ doesn't use GOTPCREL even with default visibility, but gcc 4.7 does. With -fPIC though you need hidden visibility to avoid GOTPCREL.