__libc_start_main on IA64

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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;
}

error message using strace to trace test program(compiled staticlly) on
IA64:
execve("./test4", ["./test4"], [/* 25 vars */]) = 0
--- SIGSEGV (Segmentation fault) @ 40000000000113f0 (20000000002ac140) ---
+++ killed by SIGSEGV +++
Process 19948 detached
--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subjecthttps://www.redhat.com/mailman/listinfo/redhat-list


[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux