-
lib— Definesexecutefunction -
host— Referencesexecutein source- Links to
libstatically - Provides the
executesymbol in its executable binary
- Links to
-
plugin— Referencesexecutein source- Does not link to
libat all - Leaving the
executesymbol undefined at compile time. - At runtime,
executewill be accessible becausepluginis loaded intohost, gaining access tohost's symbols.
- Does not link to
-
Commands
If you need to have binutils first in your PATH, run: echo 'export PATH="/opt/homebrew/opt/binutils/bin:$PATH"' >> /Users/macbookpro2020/.zshrc
For compilers to find binutils you may need to set: export LDFLAGS="-L/opt/homebrew/opt/binutils/lib" export CPPFLAGS="-I/opt/homebrew/opt/binutils/include"
greadelf gobjdump -p /path/to/app greadelf -p .comment target/debug/echo otool -l target/debug/echo strings target/debug/echo | grep -i gcc strings target/debug/echo | grep -i rustc gobjdump -s -j __TEXT target/debug/echo nm target/debug/echo
otool -l
objdump -j .comment -s
rustup target add x86_64-unknown-linux-gnu cargo build --target x86_64-unknown-linux-gnu dwarfdump target/debug/echo
lldb target/debug/echo image list
nm -a target/debug/echo
dsymutil target/debug/echo
cargo build --profile dev --config profile.dev.debug=0
https://users.rust-lang.org/t/mold-linker-not-working-properly-with-rust/88376 https://stackoverflow.com/questions/67511990/how-to-use-the-mold-linker-with-cargo https://stackoverflow.com/questions/3286675/readelf-like-tool-for-mac-os-x https://stackoverflow.com/questions/68343560/what-linker-was-used-to-build-a-rust-binary