I want to remove dead code from a largish project and would like to start with unused symbols. Is there anyway to get the linker to list unused symbols that it has optimized
GCC can generate a compiler warning when it encounters functions, labels and function parameters that are unused. The compiler flags -Wunused -Wunused-parameter will do this.
I'd personally recommend turning on all warnings and extra warnings when developing. The flags are -Wall -Wextra and the dead code warnings are implied by these flags, together with a whole host of other warnings that I've found useful.