Skip to content

Mach-O Object Support - #368

Open
HaydnTrigg wants to merge 2 commits into
encounter:mainfrom
HaydnTrigg:mach-o
Open

Mach-O Object Support#368
HaydnTrigg wants to merge 2 commits into
encounter:mainfrom
HaydnTrigg:mach-o

Conversation

@HaydnTrigg

Copy link
Copy Markdown
Contributor

Enable support for loading Mach-O objects

@HaydnTrigg
HaydnTrigg marked this pull request as ready for review July 19, 2026 08:40
@LagoLunatic

Copy link
Copy Markdown
Collaborator

Could you add a small test object and snapshot test?

@HaydnTrigg

Copy link
Copy Markdown
Contributor Author

Sure thing I'll put that together asap

@HaydnTrigg

Copy link
Copy Markdown
Contributor Author

Rebased the changes to make sure everything is up to date and I have added tests for arm64 armv6 armv7 i386 x86_x64 compiled using LLVM-18.1.8 using the following code:

extern "C" int printf(const char* format, ...);

__attribute__((noinline)) unsigned long long fibonacci(unsigned n) {
    unsigned long long a = 0, b = 1;
    for (unsigned i = 0; i < n; ++i) {
        unsigned long long next = a + b;
        a = b;
        b = next;
    }
    return a;
}

int main() {
    printf("Hello, world!\n");
    for (unsigned i = 0; i < 16; ++i) {
        printf("fib(%u) = %llu\n", i, fibonacci(i));
    }
    return 0;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants