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

"ld: library 'elf' not found" when compile frida-core-example.c on Mac #488

Open
bakabird opened this issue Oct 16, 2023 · 0 comments
Open

Comments

@bakabird
Copy link

Environment: macOS 14.0
CPU: Apple M2
Model: MacBook Air

I downloaded the frida-core-devkit from frida-core-devkit-16.1.4-freebsd-arm64.tar.xz.

image

Within the frida-core-example.c file, I found the gcc command as follows:

/*
 * Compile with:
 *
 * gcc -ffunction-sections -fdata-sections frida-core-example.c -o frida-core-example -L. -lfrida-core -lelf -ldl -lm -pthread -Wl,--export-dynamic,--gc-sections
 *
 * Visit https://frida.re to learn more about Frida.
 */

I attempted to execute the provided gcc command: gcc -ffunction-sections -fdata-sections frida-core-example.c -o frida-core-example -L. -lfrida-core -lelf -ldl -lm -pthread -Wl,--export-dynamic,--gc-sections. However, I encountered an error:

ld: unknown options: --export-dynamic --gc-sections.

After conducting some research, I revised the command to gcc -ffunction-sections -fdata-sections frida-core-example.c -o frida-core-example -L. -lfrida-core -lelf -ldl -lm -pthread -Wl,-export_dynamic,-dead_strip.

Now, a new error has emerged:

ld: library 'elf' not found.

What should I do?

@bakabird bakabird changed the title "ld: library 'elf' not found" when compile frida-core-example.c "ld: library 'elf' not found" when compile frida-core-example.c on Mac Oct 16, 2023
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

No branches or pull requests

1 participant