Commit de3d098d authored by Nicholas Piggin's avatar Nicholas Piggin Committed by Michael Ellerman
Browse files

powerpc/64: Add module check for ELF ABI version



Override the generic module ELF check to provide a check for the ELF ABI
version. This becomes important if we allow big-endian ELF ABI V2 builds
but it doesn't hurt to check now.

Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
Reviewed-by: default avatarJoel Stanley <joel@jms.id.au>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20221128041539.1742489-3-npiggin@gmail.com
parent f9231a99
Loading
Loading
Loading
Loading
+10 −0
Original line number Original line Diff line number Diff line
@@ -31,6 +31,16 @@
   this, and makes other things simpler.  Anton?
   this, and makes other things simpler.  Anton?
   --RR.  */
   --RR.  */


bool module_elf_check_arch(Elf_Ehdr *hdr)
{
	unsigned long abi_level = hdr->e_flags & 0x3;

	if (IS_ENABLED(CONFIG_PPC64_ELF_ABI_V2))
		return abi_level == 2;
	else
		return abi_level < 2;
}

#ifdef CONFIG_PPC64_ELF_ABI_V2
#ifdef CONFIG_PPC64_ELF_ABI_V2


static func_desc_t func_desc(unsigned long addr)
static func_desc_t func_desc(unsigned long addr)