__libc_start_main on IA64
Today I encountered a weird problem, I reimplement __libc_start_main in my program. And this program can run very well on i386 and x86_64 either compiled dynamic-linked with " gcc test.c -o test" or compiled staticlly with "gcc test.c -o test -static". But on IA64 the program can run if I compiled it using dynamic-linking, but if I compiled it staticlly, the program cannot run. I read libc_start.c in glibc, but I cannot figure out why it cannot run when compiled staticlly. I am using RHEL4U2. Could you please give me some suggestions? Thank you very much.
#include <stdio.h>
#include <unistd.h>
extern int __libc_start_main(int(*main)())
{
printf("coming to __libc_start_main\n");
int result = main();
exit(result);
}
int main()
{
printf("coming to main\n");
return 0;
}
|