How to use "--gc-sections" link option to reduce target binary size?

Rustc already tells LLVM to use what amounts to -ffunction-sections -fdata-sections and passes -Wl,--gc-sections to the linker. You don't need to pass them yourself.