mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 11:18:45 +07:00
62d0fd591d
As the bug report [1] pointed out, <linux/vermagic.h> must be included after <linux/module.h>. I believe we should not impose any include order restriction. We often sort include directives alphabetically, but it is just coding style convention. Technically, we can include header files in any order by making every header self-contained. Currently, arch-specific MODULE_ARCH_VERMAGIC is defined in <asm/module.h>, which is not included from <linux/vermagic.h>. Hence, the straight-forward fix-up would be as follows: |--- a/include/linux/vermagic.h |+++ b/include/linux/vermagic.h |@@ -1,5 +1,6 @@ | /* SPDX-License-Identifier: GPL-2.0 */ | #include <generated/utsrelease.h> |+#include <linux/module.h> | | /* Simply sanity version stamp for modules. */ | #ifdef CONFIG_SMP This works enough, but for further cleanups, I split MODULE_ARCH_VERMAGIC definitions into <asm/vermagic.h>. With this, <linux/module.h> and <linux/vermagic.h> will be orthogonal, and the location of MODULE_ARCH_VERMAGIC definitions will be consistent. For arc and ia64, MODULE_PROC_FAMILY is only used for defining MODULE_ARCH_VERMAGIC. I squashed it. For hexagon, nds32, and xtensa, I removed <asm/modules.h> entirely because they contained nothing but MODULE_ARCH_VERMAGIC definition. Kbuild will automatically generate <asm/modules.h> at build-time, wrapping <asm-generic/module.h>. [1] https://lore.kernel.org/lkml/20200411155623.GA22175@zn.tnic Reported-by: Borislav Petkov <bp@suse.de> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Acked-by: Jessica Yu <jeyu@kernel.org>
32 lines
976 B
C
32 lines
976 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef _ASM_IA64_MODULE_H
|
|
#define _ASM_IA64_MODULE_H
|
|
|
|
#include <asm-generic/module.h>
|
|
|
|
/*
|
|
* IA-64-specific support for kernel module loader.
|
|
*
|
|
* Copyright (C) 2003 Hewlett-Packard Co
|
|
* David Mosberger-Tang <davidm@hpl.hp.com>
|
|
*/
|
|
|
|
struct elf64_shdr; /* forward declration */
|
|
|
|
struct mod_arch_specific {
|
|
struct elf64_shdr *core_plt; /* core PLT section */
|
|
struct elf64_shdr *init_plt; /* init PLT section */
|
|
struct elf64_shdr *got; /* global offset table */
|
|
struct elf64_shdr *opd; /* official procedure descriptors */
|
|
struct elf64_shdr *unwind; /* unwind-table section */
|
|
unsigned long gp; /* global-pointer for module */
|
|
|
|
void *core_unw_table; /* core unwind-table cookie returned by unwinder */
|
|
void *init_unw_table; /* init unwind-table cookie returned by unwinder */
|
|
unsigned int next_got_entry; /* index of next available got entry */
|
|
};
|
|
|
|
#define ARCH_SHF_SMALL SHF_IA_64_SHORT
|
|
|
|
#endif /* _ASM_IA64_MODULE_H */
|