From 10773db08d767d127772489887775a9ec860ff42 Mon Sep 17 00:00:00 2001 From: whitequark Date: Sat, 1 Aug 2015 20:26:27 +0300 Subject: [PATCH] libdyld: handle unaligned relocations. --- software/libdyld/dyld.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/software/libdyld/dyld.c b/software/libdyld/dyld.c index 50a48f2f..c6bdae48 100644 --- a/software/libdyld/dyld.c +++ b/software/libdyld/dyld.c @@ -43,7 +43,8 @@ static int fixup_rela(struct dyld_info *info, Elf32_Rela *rela, return 0; } - *(Elf32_Addr*)(info->base + rela->r_offset) = value; + memcpy((Elf32_Addr*)(info->base + rela->r_offset), &value, + sizeof(Elf32_Addr)); return 1; } -- 2.30.2