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 #473

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

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

RyanGlScott opened this issue Jul 26, 2024 · 0 comments
Labels
arch:ppc PowerPC issues bug loader Issues related to macaw-loader

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).

@RyanGlScott RyanGlScott transferred this issue from GaloisInc/macaw-loader Feb 26, 2025
@RyanGlScott RyanGlScott added loader Issues related to macaw-loader bug arch:ppc PowerPC issues and removed bug labels Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch:ppc PowerPC issues bug loader Issues related to macaw-loader
Projects
None yet
Development

No branches or pull requests

1 participant