This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Does dladdr1 allocate heap memory?
- From: Ponnuvel Palaniyappan <pponnuvel at gmail dot com>
- To: libc-help at sourceware dot org
- Date: Fri, 10 Nov 2017 18:52:07 +0000
- Subject: Does dladdr1 allocate heap memory?
- Authentication-results: sourceware.org; auth=none
Hi,
I have a custom dlsym-like symbol resolver (dlsym allocates memory on
failure which causes problem when using my
code alongside malloc interposing libraries). Getting the struct link_map
is one of the steps and I am wondering
if I can make use of dladdr1 for that purpose. That obviously requires
dladdr1 to *not* allocate heap memory.
In my testing, it appears be heap-alloc-safe. But I am wondering if there
are any edge cases where it might not be so.
Thanks.