This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: preallocated static tls block too small for a dlopened file


On Thu, Jul 23, 2009 at 6:57 AM, Mathieu Lacage<mathieu.lacage@gmail.com> wrote:
> ?void *symbol = dlsym (handle, "main");

You fail to check if symbol returns NULL.

Once you fix this, and use dlerror() to check for the error, you will
get the following result:

dlopen "./test: cannot allocate memory in static TLS block"
./run.sh: line 3:  7720 Aborted                 ./dlopen ./test

Remember to always check the return of every function!

Cheers,
Carlos.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]