bug-glibc
[Top][All Lists]
Advanced

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

Statically linked application gives error in dlopen()


From: Muthu_T
Subject: Statically linked application gives error in dlopen()
Date: Fri, 19 Sep 2003 00:25:06 -0500

Hi,

Scenario 1: RedHat AS2.1

   If I statically link an application which uses dlopen(), then the
executable
Works fine in AS2.1 and 8.0. But in 9.0 dlopen() gives the following
error:

/lib/tls/libc.so.6: unexpected reloc type 0x0e


Scenario 2: RH 8.0

   If I statically link an application in RedHat 8.0, then the
executable works
Fine in 8.0, but in 9.0 dlopen() gives the following error:

cannot handle file 'libc.so.6' with TLS data


Please forget about the GPL/LGPL issues. For some reasons I don't want
to create dynamic applications.

Any ideas?

Thanks.

--T. Muthu Mohan


-----[ mystatic.cpp ]----------------

#include <iostream.h>
#include <dlfcn.h>

#define LIBNAME "libz.so"

int main()
{
        void *pHandle = dlopen(LIBNAME, RTLD_NOW);
        cout << "After Loading " << LIBNAME << endl << dlerror() <<
endl;
        if (pHandle) {
                cout << "Loaded Successfully!" << endl;
                dlclose(pHandle);
                cout << "Unloaded Successfully!" << endl;
        }
        return 0;
}

-----[ output in AS2.1 & 8.0 ] --------------------

# g++ -static mystatic.cpp  -ldl
# ./a.out
After Loading libz.so
(null)
Loaded Successfully!
Unloaded Successfully!

----[ output in RH 9.0 ] --------------------------
# ./a.out
After Loading libz.so
/lib/tls/libc.so.6: unexpected reloc type 0x0e





reply via email to

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