title: Rename referenced symbol version in binary
body: <p>Is there a utility for editing the symbol version in a compiled binary (executable or shared library)?</p>
  
  <p>For example, if I have</p>
  
  <pre><code>&gt; nm a.out
  ...
                   U powf@@GLIBC_2.27
  </code></pre>
  
  <p>I would like to change it to</p>
  
  <pre><code>&gt; nm a.out
  ...
                   U powf@GLIBC_2.2.5
  </code></pre>
  
  <p>I'm able to make this version change by adding</p>
  
  <pre class="lang-cpp prettyprint-override"><code>__asm__(".symver powf,powf@GLIBC_2.2.5");
  </code></pre>
  
  <p>to a source file, but I want to do this for binaries that are already compiled.</p>
  
  <p>Editing the binary hex <em>almost</em> works, but since desired symbol version is 1 character longer than the original, I can only manage to make it say</p>
  
  <pre><code>/usr/lib/libm.so.6: version `GLIBC_2.2.' not found
  </code></pre>
  
  <p>at runtime.</p>
  
  <p>Overall, I'm attempting to make a binary compiled against glibc 2.27+ compatible with older versions of glibc, and if this method works, it would be far easier than other alternatives, e.g. compiling a custom GCC/glibc/libstdc++/dependencies toolchain.</p>