Skip to content

Commit

Permalink
kpatch/LoongArch: fix build error on non-LoongArch architectures
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
georgejguo committed Nov 8, 2024
1 parent 1f52740 commit 5826776
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions kpatch-build/kpatch-elf.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
* ****************/
Expand Down

0 comments on commit 5826776

Please sign in to comment.