Questions tagged [otool]

otool is command line tool of MacOS X that displays info of an object. The otool command displays specified parts of object files or libraries.

136 questions
3
votes
1 answer

Fix paths in dylib files using install_name_tool

I'm trying to compile my C++ project after updating OS to El Capitan. However, I faced a few snags along the way: dyld: Library not loaded: pathB/libIceUtil.34.dylib Referenced from: pathA/libSlice.34.dylib Reason: image not found The problem is…
xeroqu
  • 425
  • 5
  • 14
3
votes
1 answer

Relative paths in otool output?

I'm having some issues with a library file compiled from C++, so I've used the otool command line utility (on OSX) to look at the files it links against. This is the output: ! otool -L pyopenvdb.so pyopenvdb.so: pyopenvdb.so (compatibility…
Bill Cheatham
  • 11,396
  • 17
  • 69
  • 104
3
votes
1 answer

OS X: dylib rpath wrong after compiling

I'm building cyrus sasl2 libraries from source. The libs get installed in /usr/local/lib, and the headers in /usr/local/include/sasl, which is proper. However, when I run apps that try to use them, I get: dyld: Library not loaded: /libsasl2.dylib …
AaplMike
  • 343
  • 1
  • 4
  • 15
3
votes
1 answer

Why are the first 4 bytes of 64-bit addresses printed as 0x00000001?

I'm looking at the disassembly of some x86_64 code with Apple's otool. Here's a sample of the disassembly, as outputted by otool: 0000000100055de4 movq $0x00000000,%rax Only the last 4 bytes in that offset, the 00055de4, represent the file…
Maxpm
  • 24,113
  • 33
  • 111
  • 170
3
votes
1 answer

Wrong method implementation address from otool for armv7?

I'm constantly getting 1 byte offset for implementation address of method shown by 'otool'. For an example 'otool -o' gives 0xe99d5 but 'otool -tvV' gives: +[NSError(SomeCategory) someMethod]: 000e99d4 b590 push {r4, r7,…
3
votes
1 answer

otool error : is not an object file

I have two files on Mac OS. One Mach-O executable i386 and one data (same exec icon in my Finder). When I execute otool -tV command on the first I have my assembler code printed. But when I write it for my second file I have this message : myFile:…
Pete
  • 314
  • 4
  • 16
3
votes
2 answers

Xcode 4, dylib & install_name_tool

I'm trying to get a dylib working in my OSX project. Ive been reading a few samples, this one specifically: Xcode 4 adding dylib But I still cannot get it to work. Here are the steps I have performed: Copied the testing.1.dylib to my Xcode projects…
Kyle
  • 17,317
  • 32
  • 140
  • 246
2
votes
1 answer

how to get Xcode to set LC_RPATH (so that @rpath loads will work)?

I want to make a command-line tool with a few bundled frameworks that it needs (SDL and related libs). I have Xcode set to "Embed & Sign" these frameworks, and this results in them being copied to the build folder next to the executable. The…
Joe Strout
  • 2,634
  • 2
  • 28
  • 39
2
votes
1 answer

Changing dylib library path with install_name_tool -id, nothing changes

I'm trying to put an executable together to send to another computer. otool -L "exec_name" returns: /usr/local/opt/glfw/lib/libglfw.3.dylib (compatibility version 3.0.0, current version 3.3.0) trying to change it to my executable…
user1298416
  • 341
  • 4
  • 11
2
votes
1 answer

How to print all symbols that a mach-o binary imports from dylibs?

I am new to MacOS & MacOS programming. I would like to know how an application is working (by simply having a glimpse of the binary's imported system APIs for learning). I tried otool, printed the help message, I saw the message says -L prints the…
張俊芝
  • 187
  • 1
  • 9
2
votes
0 answers

How to get function/symbol information from within a binary file in IOS

We have developed a IOS application and found that application binary file is using _malloc() function somewhere inside. $otool -IV Reminders | grep _malloc 0x0000000100415b3a 1436 _malloc 0x0000000100415b40 1437 _malloc_size $ We have not used…
user2679476
  • 365
  • 3
  • 12
2
votes
1 answer

What do the flags in a mach-o header refer to?

I was trying out this and I noticed the flags portion of the mach-o header and I was wondering what it did. I tried googling it and found lots of references to it but nothing explaining what the flags are. If I use otool on a basic hello world…
2
votes
2 answers

Counting the number of selectors in an objective-c binary

Is there a tool/script which can help me iterate over (or just count) all the selectors in a objective-c binary. I want to statically analyze objective c binaries and get that metric. I tried otool -tV but all it dumps is hex-data which I'm unable…
A. K.
  • 34,395
  • 15
  • 52
  • 89
2
votes
1 answer

otool output for iOS apps

If I run otool -L ... on the main executable of my iOS .ipa file, I see the following output: /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation /System/Library/Frameworks/UIKit.framework/UIKit ... …
2
votes
0 answers

operand order is difference between xcrun otool and capstone, IDA

So I have a simple hello world program: #include int main(int argc, char *argv[]) { printf("Hello World!\n"); return 0; } if we compile and get the binary on x86_64, and print its asm code and machine code: asm code: % xcrun otool…
Wingzero
  • 9,644
  • 10
  • 39
  • 80