verma wrote: > I tried to run a shared object. > I am able to build and run the shared object after giving entry point and -I > /user/lib/ld.so.1 option, but > its giving segmentation fault after printing my printf statement. > I changed the code from return(0) and call exit(0), now its working fine. > > int > foo() > { > printf("Hi from foo\n"); > return(0); > } > > int > foo() > { > printf("Hi from foo\n"); > exit(0); > } > > Can any one help me why its not working when I called return(0). > Is this due to c run time library(crt1.s) code or something else. > > > This message posted from opensolaris.org > _______________________________________________ > tools-linking mailing list > tools-linking at opensolaris.org
I may be missing something, but if foo() is your entry point, what are you returning to? I think exit(0) is your only way out. - Ali