bug-glibc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

dlsym broken in glibc (2.2.5)


From: Felix Gaehtgens
Subject: dlsym broken in glibc (2.2.5)
Date: Thu, 19 Sep 2002 19:18:02 +0100

Hi everybody,

It seems that under Linux (glibc2.2.5), the libdl is just plainly
*broken*. I've attached a very simple C program that should give me the
address of the function "testfunc". Under Solaris (8), it works. However
under Linux (RedHat 7.3) it doesn't. Am I doing something wrong, or is
this a real bug?

Regards,

- Felix


 Under Solaris, I get:

 > gcc symtest.c -o symtest -ldl
 > ./symtest
 Function pointer: 1075c
 >

 Under Linux I get:

 > gcc symtest.c -o symtest -ldl
 > ./symtest
 dlym failed: ./symtest: undefined symbol: testfunc
 >

Here is the simple program:

#include <dlfcn.h>
#include <stdio.h>

main()
{
  void *func;
  void *handle = dlopen (0, RTLD_GLOBAL|RTLD_LAZY);
  if (!handle) {
    printf ("dlopen failed: %s\n", dlerror());
    exit (-1);
  }
  func = dlsym (handle, "testfunc");
  if (func) {
    printf ("Function pointer: %x\n", func);
  } else {
    printf ("dlsym failed: %s\n", dlerror());
    exit (-1);
  }
}


void testfunc()
{
}



Visit our website at http://www.britannia.co.uk

This Email and any attachments contains confidential information and is intended
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not
the intended recipient you must not disclose, distribute, copy, print or 
rely on any of the information contained, and all copies must be deleted 
immediately.
Whilst we take reasonable steps to try to identify any software viruses, 
any attachments to this e-mail may nevertheless contain viruses which our 
anti-virus software has failed to identify. You should therefore carry out 
your own anti-virus checks before opening any documents. Britannia Building
Society will not accept any liability for damage caused by computer viruses 
emanating from any attachment or other document supplied with this e-mail.
Britannia Building Society reserves the right to monitor and archive all 
e-mail communications through its network. No representative or employee 
of Britannia Building Society has the authority to enter into any contract 
on behalf of Britannia Building Society by email.

Britannia Building Society is regulated by the Financial Services Authority
and advises on and sells the life assurance, pension and unit trust products 
provided  only by the Britannic marketing group.
Britannia Building Society, Britannia House, Leek, Staffs, ST13 5RG.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]