title: What path does @loader_path resolve to?
body: <p>I'm having a hard time understanding the absolute path that a <code>@loader_path</code> within a file refers to.</p>
  
  <pre><code>user@local:~$ otool -L zlib.so 
  zlib.so:
      @loader_path/../../libz.1.dylib (compatibility version 1.0.0, current version 1.2.7)
      /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
      /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.0.0)
  </code></pre>
  
  <p>I want to know where the system looks to find libz.1.dylib.</p>
  
  <p>From some <a href="http://developer.apple.com/library/mac/#documentation/Darwin/Reference/Manpages/man1/dyld.1.html" rel="noreferrer">Mac documentation</a>:</p>
  
  <blockquote>
    <p>@loader_path/
                  This variable is replaced with the path to the directory containing the  mach-o  binary  which contains  the load command using @loader_path. Thus, in every binary, @loader_path resolves to a different path</p>
  </blockquote>
  
  <p>I would have guessed this means that @loader_path is just the path to the object file (<code>zlib.so</code>), but that doesn't seem to be true.</p>
  
  <p>Is there any command line utility that will resolve @loader_path to the actual path that is used when attempting to open a library?</p>