efi/libstub: Move efi_random_alloc() into separate source file
authorArd Biesheuvel <ardb@kernel.org>
Mon, 10 Feb 2020 16:02:41 +0000 (17:02 +0100)
committerArd Biesheuvel <ardb@kernel.org>
Sun, 23 Feb 2020 20:57:15 +0000 (21:57 +0100)
commit0ed02bdaa7d8d93157a7055a23b03774c930f561
treeda8e8acfb3d3d2c1ca26cd918de2e21a9f1315d7
parent1e45bf7372c48c78e1f7e538fd3e612946f6ad20
efi/libstub: Move efi_random_alloc() into separate source file

efi_random_alloc() is only used on arm64, but as it shares a source
file with efi_random_get_seed(), the latter will pull in the former
on other architectures as well.

Let's take advantage of the fact that libstub is a static library,
and so the linker will only incorporate objects that are needed to
satisfy dependencies in other objects. This means we can move the
random alloc code to a separate source file that gets built
unconditionally, but only used when needed.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
drivers/firmware/efi/libstub/Makefile
drivers/firmware/efi/libstub/random.c
drivers/firmware/efi/libstub/randomalloc.c [new file with mode: 0644]