This is the mail archive of the
mailing list for the glibc project.
Re: PATCH: Implement static dl_iterate_phdr
On Tue, Oct 14, 2003 at 08:33:02AM -0700, H. J. Lu wrote:
> > Normal glibc behaviour is to supply stubs for functions declared
> > in headers, but not supported. generic dl-iteratephdr-static.c
> > might want to use stub_warning though...
> In this case, it should be a link time error since it will never
It will work, return -1/ENOSYS. That's valid return value from this
> > Because dl_iterate_phdr is heavily used on all arches for dynamic binaries
> > and for -static on IA-64?
> > > BTW, my user finds dl_iterate_phdr useful on other arches, but it is
> > > kind of useless when it only works with dynamic binaries.
> > Can you expand on why is it useless?
> When you compile a .c file, you may not know if it will be used to
> create a static or dynamic binary. To be reliable, I can't use
> dl_iterate_phdr at all if it isn't available for static binary unless
> I know it will never be the part of a static binary.
You need to test for errors of functions you call. So, if you test for
-1/ENOSYS in this case, there is no problem.