This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: How to implement a kernel feature check in the crt* files?
> But it would still be necessary to recognize that situation in order to
> prevent the check from being executed since accessing the ELF header field
> would segfault. The only way I see is to compare the AT_ENTRY field with
> the _start address which basically tells you if the current auxv does belong
> to the executable or not.
I don't really see what you are talking about there. There is nothing to
recognize. ld.so creates the situation, so it knows what it should do.
> > That said, it seems like ld.so could fix this. i.e., update the auxv
> > fields on the stack to point to where it's loaded the executable
> > rather than to ld.so itself.
>
> Ok sounds reasonable. In order to fix it completely this would mean to
> duplicate the auxv setup from the kernel in ld.so and keep both in sync.
I don't know exactly what you have in mind, but it sounds rather off to me.
There is nothing to "duplicate". There are a few known auxv entries that
refer to the loaded image, so ld.so needs to change those entries.
Thanks,
Roland