title: rpath=$ORIGIN not having desired effect?
body: <p>I've got a binary &quot;CeeloPartyServer&quot; that needs to find libFoundation.so at runtime, on a FreeBSD machine.  They're both in the same directory.  I compile (on another platform, using a cross compiler) CeeloPartyServer using linker flag <code>-rpath=$ORIGIN</code>.</p>
  <pre><code>&gt; readelf -d CeeloPartyServer |grep -i rpath
   0x0000000f (RPATH)                      Library rpath: [$ORIGIN]
  &gt; ls
  CeeloPartyServer    Contents        Foundation.framework    libFoundation.so
  &gt; ./CeeloPartyServer 
  /libexec/ld-elf.so.1: Shared object &quot;libFoundation.so&quot; not found, required by &quot;CeeloPartyServer&quot;
  </code></pre>
  <p>Why isn't it finding the library when I try to run it?</p>
  <p>My exact linker line is: <code>-lm -lmysql -rpath=$ORIGIN</code>.</p>
  <p>I am pretty sure I don't have to escape $ or anything like that since my readelf analysis does in fact show that library rpath is set to $ORIGIN.  What am I missing?</p>