This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

sparc stack analysis


Hello,

I have strong interest in sparc architecture, assuming this small program:
-bash-3.00$ cat foo.c
#include<stdio.h>

void func1(char *);
void func2(char *);

main(int argc, char *argv[])
{
       char foo[256];
       strcpy(foo,argv[1]);
       func1(foo);
       exit(1);
}
void
func2(char *foo){
       char hello[128];
       strcpy(hello,foo);
       printf("%s\n",foo);
}

void
func1(char *foo){
       func2(foo);
       }

1. Would anyone mind to detailed describe how a function main() calls func1() and func2() as well. I have interested in, where is stored the return address from main()? how does it work the save/ret schema?

2. What are the components of a typical sparc stack? What are the most important registers to know?

I know this is a bit off-topic but I am sure many users of this lists, specially those with interest on Sparc architecture, would find this very useful.

Thanks for any help, diagram, link, document,

ework0


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]