crt1.S start code

yp.cheung at pithk.com yp.cheung at pithk.com
Sat Dec 24 05:38:46 UTC 2005


> On Friday 23 December 2005 20:16, Lei Sun wrote:
>> I actully dumped out the stack from kernel , and also dumped stack and
>> a3
>> from uClibc, i saw the difference
>
> lemme rephrase this
>
> if you want the code changed, go through the libc-ports mailing list:
> http://sourceware.org/ml/libc-ports/
>
> uClibc is using the same elf startup code as glibc and they both work on
> my
> arm machines (i'm sure i would have noticed if something so basic as argv
> wasnt being passed correctly)
>
> get glibc to change their ways and i'll sync uClibc against it
> -mike

I think I have to agree with Lei Sun.  My armnommu platform was also
having argv and envp problems after I switched uclibc from 0.9.26 to
0.9.28.  I don't know much about assembly codes, so I don't know what goes
wrong in crt1.S.  But I am sure that the problem is in that part.

For those who do not want to recompile your toolchain right now, I think
this should work for the moment:

int main(int argc, char *argv[], char *envp[]) {
  int i;
  argv = &argv[2];
  for (i=0; NULL != argv[i]; i++);
  envp = &argv[i+1];
  ...
}




More information about the uClibc mailing list