kpatch/LoongArch: fix build error on non-LoongArch architectures

Added conditional compilation to prevent 'R_LARCH_64' and 'EM_LOONGARCH'
from being referenced on x86 and other non-LoongArch architectures. This
ensures the code works across different architectures without errors.

Signed-off-by: George Guo <guodongtai@kylinos.cn>
This commit is contained in:
George Guo 2024-11-08 15:03:26 +08:00
parent 1f527405a2
commit 58267765c8

View File

@ -31,6 +31,11 @@
#define SHF_RELA_LIVEPATCH 0x00100000
#define SHN_LIVEPATCH 0xff20
#ifndef __loongarch__
#define EM_LOONGARCH 258 /* LoongArch */
#define R_LARCH_64 2
#endif
/*******************
* Data structures
* ****************/