[PATCH] _dl_iterate_phdr rework

Carmelo AMOROSO carmelo.amoroso at st.com
Tue Jan 22 14:44:39 UTC 2008

Hi All,
the attached patch will solve an problem when statically linking
a C++ application with gcc configured to use unwind-dw2-fde-glibc 
This needs _dl_iterate_phdr to be included into libc.a instead of libdl.a,
and the implementation has been fixed to handle the static case too 
(based on glibc code).
For the dynamic case, it's still present in ld.so.
Moreover, _dl_loaded_modules has been moved too (being used by 

This has accomplished in the following way:

ldso/ldso/dl-elf.c:           removed _dl_iterate_phdr code and include 
"dl-iterate-phdr.c" source
ldso/ldso/dl-iterate-phdr.c : new file containing the fixed 
_dl_iterate_phdr function
ldso/ldso/dl-hash.c:          removed _dl_loaded_modules definition
ldso/ldso/dl-symbols.c:       included _dl_loaded_modules defintion
ldso/ldso/ldso.c:             include "dl-symbols.c"

libc/misc/elf/dl-core.c:      new file including dl-symbols.c and 
dl-iterate-phdr.c from ldso directory

The idea is to use dl-symbols.c to keep all symbols common among ldso 
and libc.a
(note that into the nptl branch another file dl-support.c will be added 
to keep some
TLS specific functionalities that are shared between ldso and libc.a)

Thanks to Peter Mazinger for his suggestions on this topic.

Any comments are welcome.


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: dl_iterate_phdr.patch
Url: http://lists.busybox.net/pipermail/uclibc/attachments/20080122/ca88c5c3/attachment-0002.diff 

More information about the uClibc mailing list