Using nm (1) to display symbols from an object file built for arm64 on OS X

Does anyone know how one can enumerate symbols from an object file that I created for arm64 architecture?

I tried to use nm

, but it gave me an error:

bfd_mach_o_scan: unknown architecture0x100000c/0x0 
File format not recognized

      

Can you do the same using otool

?

+3


source to share


1 answer


The system nm

does not read arm64. You need to use the nm

one that comes with your arm64 SDK (i.e. iphoneos SDK in Xcode). This is the same path you ran clang

.



$ xcrun -sdk iphoneos clang -arch arm64 main.c
$ xcrun -sdk iphoneos nm a.out 
0000000100000000 T __mh_execute_header
0000000100007f4c T _main
                 U _printf
                 U dyld_stub_binder

      

+4


source







All Articles