summaryrefslogtreecommitdiff
path: root/kexec/arch/mips/kexec-elf-rel-mips.c
diff options
context:
space:
mode:
Diffstat (limited to 'kexec/arch/mips/kexec-elf-rel-mips.c')
-rw-r--r--kexec/arch/mips/kexec-elf-rel-mips.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/kexec/arch/mips/kexec-elf-rel-mips.c b/kexec/arch/mips/kexec-elf-rel-mips.c
new file mode 100644
index 0000000..6442fb9
--- /dev/null
+++ b/kexec/arch/mips/kexec-elf-rel-mips.c
@@ -0,0 +1,42 @@
+/*
+ * kexec-elf-rel-mips.c - kexec Elf relocation routines
+ * Copyright (C) 2007 Francesco Chiechi, Alessandro Rubini
+ * Copyright (C) 2007 Tvblob s.r.l.
+ *
+ * derived from ../ppc/kexec-elf-rel-ppc.c
+ * Copyright (C) 2004 Albert Herranz
+ *
+ * This source code is licensed under the GNU General Public License,
+ * Version 2. See the file COPYING for more details.
+*/
+
+#include <stdio.h>
+#include <elf.h>
+#include "../../kexec.h"
+#include "../../kexec-elf.h"
+
+int machine_verify_elf_rel(struct mem_ehdr *ehdr)
+{
+ if (ehdr->ei_data != ELFDATA2MSB) {
+ return 0;
+ }
+ if (ehdr->ei_class != ELFCLASS32) {
+ return 0;
+ }
+ if (ehdr->e_machine != EM_MIPS) {
+ return 0;
+ }
+ return 1;
+}
+
+void machine_apply_elf_rel(struct mem_ehdr *ehdr, unsigned long r_type,
+ void *location, unsigned long address, unsigned long value)
+{
+ switch(r_type) {
+
+ default:
+ die("Unknown rela relocation: %lu\n", r_type);
+ break;
+ }
+ return;
+}