summaryrefslogtreecommitdiff
path: root/kexec
diff options
context:
space:
mode:
authorAníbal Limón <anibal.limon@linux.intel.com>2015-03-26 16:19:58 +0000
committerSimon Horman <horms@verge.net.au>2015-04-07 10:22:15 +0900
commit5edcbfd1368e84fce913ceeeca7b712c524dc20d (patch)
treeb9adc4423ce3f180d8742364fc75e20d0bddbf54 /kexec
parent720d110389f20012b478d376abcb3121c2fcb075 (diff)
x86_64: Add support to build kexec-tools with x32 ABI
Summary of changes, configure.ac: Add test for detect x32 ABI. purgatory/arch/x86_64/Makefile: Not use mcmodel large when x32 ABI is set. kexec/arch/x86_64/kexec-elf-rel-x86_64.c: When x32 ABI is set use ELFCLASS32 instead of ELFCLASS64. kexec/kexec-syscall.h: Add correct syscall number for x32 ABI. Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'kexec')
-rw-r--r--kexec/arch/x86_64/kexec-elf-rel-x86_64.c4
-rw-r--r--kexec/kexec-syscall.h4
2 files changed, 8 insertions, 0 deletions
diff --git a/kexec/arch/x86_64/kexec-elf-rel-x86_64.c b/kexec/arch/x86_64/kexec-elf-rel-x86_64.c
index c795037..06db7f0 100644
--- a/kexec/arch/x86_64/kexec-elf-rel-x86_64.c
+++ b/kexec/arch/x86_64/kexec-elf-rel-x86_64.c
@@ -8,7 +8,11 @@ int machine_verify_elf_rel(struct mem_ehdr *ehdr)
if (ehdr->ei_data != ELFDATA2LSB) {
return 0;
}
+#ifdef __ILP32__
+ if (ehdr->ei_class != ELFCLASS32) {
+#else
if (ehdr->ei_class != ELFCLASS64) {
+#endif
return 0;
}
if (ehdr->e_machine != EM_X86_64) {
diff --git a/kexec/kexec-syscall.h b/kexec/kexec-syscall.h
index ce2e20b..cab5535 100644
--- a/kexec/kexec-syscall.h
+++ b/kexec/kexec-syscall.h
@@ -31,8 +31,12 @@
#define __NR_kexec_load 268
#endif
#ifdef __x86_64__
+#ifdef __ILP32__
+#define __NR_kexec_load 528
+#else
#define __NR_kexec_load 246
#endif
+#endif
#ifdef __s390x__
#define __NR_kexec_load 277
#endif