How to get ELF auxiliary vector address outside of main(), not using **argv nor **envp?

Igor Zhbanov izh1979@gmail.com
Thu Apr 23 15:22:00 GMT 2009


2009/4/23 Ryan Arnold <ryan.arnold@gmail.com>:
> Hi Igor, there's an example in one of the libc test cases that I
> wrote.  My team member Sean Curry wrote the original auxv query code.
>
> http://sourceware.org/cgi-bin/cvsweb.cgi/libc/sysdeps/powerpc/fpu/tst-setcontext-fpscr.c?rev=1.3&content-type=text/x-cvsweb-markup&cvsroot=glibc
>
> Look at the query_auxv() function.
>
> Uli doesn't want the auxv information exported from GLIBC so this is
> the suggested method.
>
> We have a special library called libauxv to help with this but we
> haven't released it yet.  I really should get on it.
>
> Ryan

Thanks, Ryan.

/proc/self/auxv is good but... But I need to run program on 2.4.x kernel too.
And 2.4.x has no /proc/self/auxv file. Sigh.

So I need to dig in the stack. Is there any exported glibc symbol (or
function) that points
somewhere nearby **argv or **envp in the stack during all of the
program lifetime?



More information about the Libc-help mailing list