Re: Where is nm?
Re: Where is nm?
- Subject: Re: Where is nm?
- From: Ken Thomases <email@hidden>
- Date: Mon, 24 Apr 2017 17:55:59 -0500
On Apr 24, 2017, at 5:41 PM, Rick Mann <email@hidden> wrote:
>
> My man page for nm describes the tool I'm trying to use: […]
> If I invoke /usr/bin/nm -help, I get:
>
> $ nm -help
> OVERVIEW: llvm symbol table dumper
>
> USAGE: nm [subcommand] [options] <input files> --s Dump only symbols from this segment and section name, Mach-O only
>
> and the subsequent options are completely different from the man page description.
Sounds like a documentation bug separate from the question in your subject.
> I just re-ran xcode-select --install, and I still have the same /usr/bin/nm, which is an executable, not a link to something inside Xcode.
But it's still a trampoline that runs the version of nm from the Xcode (or Command Line Tools) selected by xcode-select --switch <path>.
To find where the real tool lives, use "xcrun -f nm". But it shouldn't really matter.
> But if I run it without arguments, it spits out:
>
> $ /usr/bin/nm
> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm: a.out: No such file or directory.
So, when you run it without arguments it apparently assumes it should operate on a file a.out. (That's the default name for the executable built by the linker if no other name is specified.) Then, it's telling you that there's no such file as a.out in the working directory.
In other words, this particular error is not telling you much other than that you didn't pass any arguments. As Roland said, don't do that.
> I'm trying to see what symbols and frameworks are linked by a dylib I have.
For symbols, I recommend "nm -m whatever.dylib". To just learn which frameworks it links against, nm is the wrong tool. Use "otool -L whatever.dylib".
Regards,
Ken
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden