title: Is there any way to change the SONAME of a binary directly？
body: <p>My program depends on <code>libcurl.so.3</code>, but in RHEL6 there is no symbolic link <code>libcurl.so.3 ⇾ libcurl.so.4</code> (my program can run smoothly when I create this link). However, there is symbolic link <code>libcurl.so ⇾ libcurl.so.4</code>.</p>
  
  <p>I would like to modify the <code>SONAME</code> embedded in <code>libcurl.so.3.0.0.0</code> file from <code>libcurl.so.3</code> to <code>libcurl.so</code> so that I could run my program on RHEL 6 without creating a symbolic link.</p>
  
  <p>My solution could not be optimal but I think learning how to modify the binary directly is valuable.</p>
  
  <pre><code>$readelf -d libcurl.so.3.0.0 
  
  Dynamic segment at offset 0x303cc contains 25 entries:
  
    Tag        Type                         Name/Value
   0x00000001 (NEEDED)                     Shared library: [libssl.so.2]
   0x0000000e (SONAME)                     Library soname: [libcurl.so.3]
  </code></pre>
  
  <p>I would like to change <code>libcurl.so.3</code> above to <code>libcurl.so</code>.</p>