Thank you all for the input... it was the sections.. but it was also a typo...
an extra "f" in my ld script in DATA_SEGMENT_ALIGN()
was chucking these variables out into my kernel heap....
the kernel is loaded in binary format (no elf loader) so the code ran... right up to the point
that the kernel heap started using that area for something else....
interestingly I memset kernel heap regions to 0 when I allocate them... So..... the p_environ was showing 0 as well... had I used a canary value this might have been fixed alot sooner...
iansjack wrote:
I believe that static variables can only be initialized using constant literals. I find it good practice to always explicitly assign an initial value to a static variable within a function.
The code snippet is from newlib's getenv_r.c file...
I though what you thought as well... that's why I opened the thread.
Thank you again everyone.
my eyes are tired from reading hex...