How to determine if dylib OS X is associated with -flat_namespace

I have a third-party OS X dylib that I use in my application and I do not have easy access to its creator. I would like to determine if this is related to -flat_namespace. Is it possible? If so, how?

+3
source share
1 answer

Run otool -hV in the library. If you do not see TWOLEVEL , then it was associated with -flat-namespace . For instance:

 twolevel.dylib: Mach header magic cputype cpusubtype caps filetype ncmds sizeofcmds flags MH_MAGIC_64 X86_64 ALL 0x00 DYLIB 8 672 NOUNDEFS DYLDLINK TWOLEVEL NO_REEXPORTED_DYLIBS 

vs

 flat.dylib: Mach header magic cputype cpusubtype caps filetype ncmds sizeofcmds flags MH_MAGIC_64 X86_64 ALL 0x00 DYLIB 8 672 DYLDLINK NO_REEXPORTED_DYLIBS 
+10
source

All Articles