Skip to content

Commit 31b8eb5

Browse files
committed
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 <[email protected]>
1 parent 3b637df commit 31b8eb5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

kpatch-build/kpatch-elf.h

+5
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@
3131
#define SHF_RELA_LIVEPATCH 0x00100000
3232
#define SHN_LIVEPATCH 0xff20
3333

34+
#ifndef __loongarch__
35+
#define EM_LOONGARCH 258 /* LoongArch */
36+
#define R_LARCH_64 2
37+
#endif
38+
3439
/*******************
3540
* Data structures
3641
* ****************/

0 commit comments

Comments
 (0)