From: whitequark Date: Sat, 1 Aug 2015 17:26:27 +0000 (+0300) Subject: libdyld: handle unaligned relocations. X-Git-Tag: 24jan2021_ls180~2159 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=10773db08d767d127772489887775a9ec860ff42;p=litex.git libdyld: handle unaligned relocations. --- 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; }