linux_dsm_epyc7002/arch
Ard Biesheuvel bc7c9d6205 efi/libstub/x86: Force 'hidden' visibility for extern declarations
Commit c3710de506 ("efi/libstub/x86: Drop __efi_early() export and
efi_config struct") introduced a reference from C code in eboot.c to
the startup_32 symbol defined in the .S startup code. This results in
a GOT based reference to startup_32, and since GOT entries carry
absolute addresses, they need to be fixed up before they can be used.

On modern toolchains (binutils 2.26 or later), this reference is
relaxed into a R_386_GOTOFF relocation (or the analogous X86_64 one)
which never uses the absolute address in the entry, and so we get
away with not fixing up the GOT table before calling the EFI entry
point. However, GCC 4.6 combined with a binutils of the era (2.24)
will produce a true GOT indirected reference, resulting in a wrong
value to be returned for the address of startup_32() if the boot
code is not running at the address it was linked at.

Fortunately, we can easily override this behavior, and force GCC to
emit the GOTOFF relocations explicitly, by setting the visibility
pragma 'hidden'.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Arvind Sankar <nivedita@alum.mit.edu>
Cc: Matthew Garrett <mjg59@google.com>
Cc: linux-efi@vger.kernel.org
Link: https://lkml.kernel.org/r/20200103113953.9571-3-ardb@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2020-01-10 18:55:01 +01:00
..
alpha mm/vmalloc: Add empty <asm/vmalloc.h> headers and use them from <linux/vmalloc.h> 2019-12-10 10:12:55 +01:00
arc Merge branch 'x86/mm' into efi/core, to pick up dependencies 2020-01-10 18:53:14 +01:00
arm Merge branch 'x86/mm' into efi/core, to pick up dependencies 2020-01-10 18:53:14 +01:00
arm64 Merge branch 'x86/mm' into efi/core, to pick up dependencies 2020-01-10 18:53:14 +01:00
c6x mm/vmalloc: Add empty <asm/vmalloc.h> headers and use them from <linux/vmalloc.h> 2019-12-10 10:12:55 +01:00
csky mm/vmalloc: Add empty <asm/vmalloc.h> headers and use them from <linux/vmalloc.h> 2019-12-10 10:12:55 +01:00
h8300 mm/vmalloc: Add empty <asm/vmalloc.h> headers and use them from <linux/vmalloc.h> 2019-12-10 10:12:55 +01:00
hexagon Merge branch 'x86/mm' into efi/core, to pick up dependencies 2020-01-10 18:53:14 +01:00
ia64 Merge branch 'x86/mm' into efi/core, to pick up dependencies 2020-01-10 18:53:14 +01:00
m68k mm/vmalloc: Add empty <asm/vmalloc.h> headers and use them from <linux/vmalloc.h> 2019-12-10 10:12:55 +01:00
microblaze mm/vmalloc: Add empty <asm/vmalloc.h> headers and use them from <linux/vmalloc.h> 2019-12-10 10:12:55 +01:00
mips Merge branch 'x86/mm' into efi/core, to pick up dependencies 2020-01-10 18:53:14 +01:00
nds32 mm/vmalloc: Add empty <asm/vmalloc.h> headers and use them from <linux/vmalloc.h> 2019-12-10 10:12:55 +01:00
nios2 Merge branch 'x86/mm' into efi/core, to pick up dependencies 2020-01-10 18:53:14 +01:00
openrisc mm/vmalloc: Add empty <asm/vmalloc.h> headers and use them from <linux/vmalloc.h> 2019-12-10 10:12:55 +01:00
parisc Merge branch 'x86/mm' into efi/core, to pick up dependencies 2020-01-10 18:53:14 +01:00
powerpc Merge branch 'x86/mm' into efi/core, to pick up dependencies 2020-01-10 18:53:14 +01:00
riscv Merge branch 'x86/mm' into efi/core, to pick up dependencies 2020-01-10 18:53:14 +01:00
s390 Merge branch 'x86/mm' into efi/core, to pick up dependencies 2020-01-10 18:53:14 +01:00
sh Merge branch 'x86/mm' into efi/core, to pick up dependencies 2020-01-10 18:53:14 +01:00
sparc Merge branch 'x86/mm' into efi/core, to pick up dependencies 2020-01-10 18:53:14 +01:00
um mm/vmalloc: Add empty <asm/vmalloc.h> headers and use them from <linux/vmalloc.h> 2019-12-10 10:12:55 +01:00
unicore32 mm/vmalloc: Add empty <asm/vmalloc.h> headers and use them from <linux/vmalloc.h> 2019-12-10 10:12:55 +01:00
x86 efi/libstub/x86: Force 'hidden' visibility for extern declarations 2020-01-10 18:55:01 +01:00
xtensa mm/vmalloc: Add empty <asm/vmalloc.h> headers and use them from <linux/vmalloc.h> 2019-12-10 10:12:55 +01:00
.gitignore
Kconfig arch/Kconfig: fix indentation 2019-12-04 19:44:12 -08:00