llvm-nm: refactor in order to support reading files from stdin.