aboutsummaryrefslogtreecommitdiff
path: root/qemu_mode
diff options
context:
space:
mode:
authorYour Name <you@example.com>2020-08-05 12:19:43 +1200
committerYour Name <you@example.com>2020-08-05 12:19:43 +1200
commita1c93f24d46504c29353ec64c8410b68624651f8 (patch)
treeab3dbec2173530adaf2803f86b5dda4f43a82248 /qemu_mode
parente7f27702757ac922978a4ccbdc5feeafbf902591 (diff)
downloadAFLplusplus-a1c93f24d46504c29353ec64c8410b68624651f8.tar.gz
Fix support for mips in qemu mode
Diffstat (limited to 'qemu_mode')
-rwxr-xr-xqemu_mode/build_qemu_support.sh1
-rw-r--r--qemu_mode/patches/mips-fpu.diff15
2 files changed, 16 insertions, 0 deletions
diff --git a/qemu_mode/build_qemu_support.sh b/qemu_mode/build_qemu_support.sh
index a7bfe20d..30ac158f 100755
--- a/qemu_mode/build_qemu_support.sh
+++ b/qemu_mode/build_qemu_support.sh
@@ -176,6 +176,7 @@ echo Building for CPU target $CPU_TARGET
echo "[*] Applying patches..."
patch -p1 <../patches/elfload.diff || exit 1
+patch -p1 <../patches/mips-fpu.diff || exit 1
patch -p1 <../patches/bsd-elfload.diff || exit 1
patch -p1 <../patches/cpu-exec.diff || exit 1
patch -p1 <../patches/syscall.diff || exit 1
diff --git a/qemu_mode/patches/mips-fpu.diff b/qemu_mode/patches/mips-fpu.diff
new file mode 100644
index 00000000..646d167e
--- /dev/null
+++ b/qemu_mode/patches/mips-fpu.diff
@@ -0,0 +1,15 @@
+--- a/linux-user/elfload.c 2020-07-13 20:10:37.776374566 -0700
++++ b/linux-user/elfload.c 2020-07-13 20:11:51.794957015 -0700
+@@ -2667,6 +2667,11 @@
+ char *elf_interpreter = NULL;
+ char *scratch;
+
++ memset(&interp_info, 0, sizeof(interp_info));
++#ifdef TARGET_MIPS
++ interp_info.fp_abi = MIPS_ABI_FP_UNKNOWN;
++#endif
++
+ info->start_mmap = (abi_ulong)ELF_START_MMAP;
+
+ load_elf_image(bprm->filename, bprm->fd, info,
+