I got curious and decided to run the file
command on a Rust app I compiled for Linux (Ubuntu 20.04). Why is the executable file "dynamically linked"? I though by default Rust binaries were statically linked.
$ file my_hello_world_app
my_hello_world_app: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[xxHash]=5ddb20be333a274e, with debug_info, not stripped
I tested with a few Rust bin apps, the last being a fresh hello-world app created via cargo new ...
and simply built with cargo build --release
. I also tested with two different linkers: the default and LLD. In all cases the file
command displayed "dynamically linked".