Re: Where is nm?
Re: Where is nm?
- Subject: Re: Where is nm?
- From: Rick Mann <email@hidden>
- Date: Mon, 24 Apr 2017 16:25:16 -0700
> On Apr 24, 2017, at 15:55 , Ken Thomases <email@hidden> wrote:
>
> 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.
Well, it seemed like I had an nm installed that was different from the nm I was expecting. Sure, call it a documentation bug, but my question stands, in that I wanted to verify I had the right nm.
>
>> 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.
It's not the a.out that bothers me, it's that it's showing an unexpected path (usually tools output args[0] for the name of the command).
>
> 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".
That's helpful!
> Regards,
> Ken
>
--
Rick Mann
email@hidden
_______________________________________________
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