···11/*
22This file is part of Darling.
3344-Copyright (C) 2016 Lubos Dolezel
44+Copyright (C) 2017 Lubos Dolezel
5566Darling is free software: you can redistribute it and/or modify
77it under the terms of the GNU General Public License as published by
···2222#include <mach-o/dyld_images.h>
2323#include <stdint.h>
24242525+#ifdef __cplusplus
2626+extern "C" {
2727+#endif
2828+2529void setup_gdb_notifications(uint64_t slide, uint64_t addr);
3030+3131+#ifdef __cplusplus
3232+}
3333+#endif
26342735#endif
2836
···2929 movl %ecx, -24+off(%esp)
30303131__darling_bsd_syscall:
3232- calll .L0$pb
3333-.L0$pb:
3232+ calll 1f
3333+1:
3434 popl %ecx
3535-.Ltmp0:
3636- movl L___bsd_syscall_table$non_lazy_ptr-.L0$pb(%ecx), %ecx
3535+2:
3636+ movl L___bsd_syscall_table$non_lazy_ptr-1b(%ecx), %ecx
3737 andl $0xffff, %eax // Because there is some extra stuff in upper bytes we don't need
3838 movl (%ecx,%eax,4), %eax
3939 test %eax, %eax
+1-1
src/kernel/libsyscall/bsdsyscalls/___syscall.S
···3737 pushl %ecx
3838 UNIX_SYSCALL_TRAP
3939 movl (%esp),%edx // add one element to stack so
4040- pushl %ecx // caller "pop" will work
4040+ pushl %edx // caller "pop" will work
4141 jnb 2f
4242 BRANCH_EXTERN(tramp_cerror)
43432: