diff options
author | Ard Biesheuvel <ardb@kernel.org> | 2020-02-10 17:02:32 +0100 |
---|---|---|
committer | Ard Biesheuvel <ardb@kernel.org> | 2020-02-23 21:57:12 +0100 |
commit | 6f05106e20f0ed26a2dbd6a5d44a302ce81642e0 (patch) | |
tree | 91a31176163d9fc6cadcff163367a92dc91e3aac /drivers/firmware/efi/libstub/hidden.h | |
parent | 04a7d0e15606769ef58d5cee912c5d08d93ded92 (diff) | |
download | linux-6f05106e20f0ed26a2dbd6a5d44a302ce81642e0.tar.bz2 |
efi/libstub: Use hidden visibility for all source files
Instead of setting the visibility pragma for a small set of symbol
declarations that could result in absolute references that we cannot
support in the stub, declare hidden visibility for all code in the
EFI stub, which is more robust and future proof.
To ensure that the #pragma is taken into account before any other
includes are processed, put it in a header file of its own and
include it via the compiler command line using the -include option.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Diffstat (limited to 'drivers/firmware/efi/libstub/hidden.h')
-rw-r--r-- | drivers/firmware/efi/libstub/hidden.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/firmware/efi/libstub/hidden.h b/drivers/firmware/efi/libstub/hidden.h new file mode 100644 index 000000000000..3493b041f419 --- /dev/null +++ b/drivers/firmware/efi/libstub/hidden.h @@ -0,0 +1,6 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * To prevent the compiler from emitting GOT-indirected (and thus absolute) + * references to any global symbols, override their visibility as 'hidden' + */ +#pragma GCC visibility push(hidden) |