9f842146f7c578fb082fb27ffae38a35ac3050a1
[openwrt/staging/wigyori.git] / tools / mkimage / patches / 090-macos-arm64-builing-fix.patch
1 This patch fixes compilation issues on MacOS arm64.
2 Based on discussion
3 https://github.com/u-boot/u-boot/commit/3b142045e8a7f0ab17b6099e9226296af45967d0
4
5 --- a/tools/imagetool.h
6 +++ b/tools/imagetool.h
7 @@ -272,11 +272,14 @@ int rockchip_copy_image(int fd, struct i
8 * b) we need a API call to get the respective section symbols */
9 #if defined(__MACH__)
10 #include <mach-o/getsect.h>
11 +#include <mach-o/dyld.h>
12
13 #define INIT_SECTION(name) do { \
14 unsigned long name ## _len; \
15 char *__cat(pstart_, name) = getsectdata("__DATA", \
16 #name, &__cat(name, _len)); \
17 + __cat(pstart_, name) += \
18 + _dyld_get_image_vmaddr_slide(0); \
19 char *__cat(pstop_, name) = __cat(pstart_, name) + \
20 __cat(name, _len); \
21 __cat(__start_, name) = (void *)__cat(pstart_, name); \