This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Save reference to kernel provided envp in the linker


> > Breakpoint 1, call_init (l=0x7ffff7ff9198, argc=1, argv=0x7fffffffdbd8, env=0x7fffffffdbe8) at dl-init.c:35
> > 35      {
> > (gdb) p __environ
> > $3 = (char **) 0x0
> > (gdb) p environ
> > $4 = (char **) 0x7fffffffdbe8
> > (gdb) p __environ
> > $5 = (char **) 0x7fffffffdbe8
> >
> 
> __environ is set to the same value later.
> 

Right, that's why I figured that it's some relocation quirk (won't
call it a bug till I prove it as such) that I haven't understood yet.
Printing environ results in __environ being resolved.  It has the same
effect in code, where referencing environ fixes the reference to
__environ somehow.

Siddhesh


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]