This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: preallocated static tls block too small for a dlopened file
- From: "Carlos O'Donell" <carlos at systemhalted dot org>
- To: Mathieu Lacage <mathieu dot lacage at gmail dot com>
- Cc: libc-help at sourceware dot org
- Date: Sat, 25 Jul 2009 12:25:04 -0400
- Subject: Re: preallocated static tls block too small for a dlopened file
- References: <74fef6df0907230357t6f3f7b9awa84660836cd97bde@mail.gmail.com>
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.