title: "relocation 6 has invalid symbol index 13" when linking against OpenSSL libraries
body: <p>I am getting the following error when linking against OpenSSL libraries:</p>
  
  <pre><code>/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info):
     relocation 6 has invalid symbol index 13
  </code></pre>
  
  <p>I've been trying to find out the solution. I want to hash, what functions I need to call, and where to find the string once it has been hashed. I'm confused with regards to what is there in the code.</p>
  
  <pre class="lang-c prettyprint-override"><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  #include &lt;openssl/crypto.h&gt;
  #include &lt;openssl/sha.h&gt;
  
  unsigned char *SHA1(const unsigned char *d, size_t n, unsigned char *md)
  {
      SHA_CTX c;
      static unsigned char m[SHA_DIGEST_LENGTH];
  
      if (md == NULL)
          md = m;
  
      if (!SHA1_Init(&amp;c))
          return NULL;
  
      SHA1_Update(&amp;c, d, n);
      SHA1_Final(md, &amp;c);
  
      OPENSSL_cleanse(&amp;c, sizeof(c));
  
      return (md);
  }
  </code></pre>