"relocation 6 has invalid symbol index 13" when linking against OpenSSL libraries

I am getting the following error when linking against OpenSSL libraries:

/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info):
   relocation 6 has invalid symbol index 13

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.

#include <stdio.h>
#include <string.h>
#include <openssl/crypto.h>
#include <openssl/sha.h>

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(&c))
        return NULL;

    SHA1_Update(&c, d, n);
    SHA1_Final(md, &c);

    OPENSSL_cleanse(&c, sizeof(c));

    return (md);

Source: gcc

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.