Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macaw-loader-ppc crashes on PPC64 musl-gcc binaries #21

Open
RyanGlScott opened this issue Jul 26, 2024 · 0 comments
Open

macaw-loader-ppc crashes on PPC64 musl-gcc binaries #21

RyanGlScott opened this issue Jul 26, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@RyanGlScott
Copy link
Contributor

Using a powerpc64-linux-musl-gcc binary obtained from https://musl.cc/, I compiled the following simple binary:

#include <stdlib.h>

int main(void) {
    int* x = malloc(sizeof(int));
    *x = 42;
    free(x);
    return 0;
}

And then loaded it using macaw-loader-ppc. Surprisingly, this fails with:

PPCTOCLoadError (MissingTOCSection ".opd")

And indeed, the compiled binary lacks an .opd section, unlike most other PPC64 binaries. I propose that we make macaw-loader-ppc less strict here. Specifically, it it encounters a PPC64 section without an .opd section, load it using the same code paths that one would use for PPC32 binaries (but using 64 bits instead of 32 bits).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant