Since precise, --as-needed is the default linker option and command line
arguments order matters:

$ cat test.c
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <openssl/md5.h>

const char *string = "asdfghjklpoiuztreq";

int main()
{
  unsigned char result[MD5_DIGEST_LENGTH];

  MD5(string, strlen(string), result);
  return EXIT_SUCCESS;
}

$ gcc -c test.c
$ ld --as-needed -lcrypto test.o
ld: warning: cannot find entry symbol _start; defaulting to 00000000004000e8
test.o: In function `main':
test.c:(.text+0x53): undefined reference to `MD5'
test.c:(.text+0x6c): undefined reference to `__stack_chk_fail'
$

vs.

$ ld --as-needed test.o -lcrypto
ld: warning: cannot find entry symbol _start; defaulting to 0000000000400300
$

** Changed in: openssl (Ubuntu)
       Status: New => Incomplete

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/900381

Title:
  Missing symbols in openssl 1.0.0e-2ubuntu4

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/openssl/+bug/900381/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to