Sh wrote:
Hello All,
I have troubles with assembly in Solaris 10 x86
Such operations like reading/writing to a file, executing new process , etc, 
work fine , but my every programm, written in assembly ,ends up with 
segmentation fault, even Hello world program. I call   exit() function(or 
lwp_exit()) , but still get seg fault.So, how must typical program look like(I 
mean the exit operation)?I see such program as the following:
...
code
......
pushl $0
pushl $0 //
xorl %eax,%eax
 movl $0x1,%eax
lcall $0x1,$0x0


And where i can find docs about x86 assembly under solaris (except 
docs.sun.com)?
This message posted from opensolaris.org
_______________________________________________
opensolaris-discuss mailing list
[email protected]

Use gcc to link your program to bring in crt[io].o  Eg:

[EMAIL PROTECTED]:/tmp 69% more hello.c
main()
{
        printf(" hello, world\n");
}
[EMAIL PROTECTED]:/tmp 70% ld -o hello a.out -lc
[EMAIL PROTECTED]:/tmp 71% ./hello
 hello, world
Segmentation Fault (core dumped)
[EMAIL PROTECTED]:/tmp 72% cat hello.c
main()
{
        printf(" hello, world\n");
}
[EMAIL PROTECTED]:/tmp 73% gcc -S hello.c
[EMAIL PROTECTED]:/tmp 74% gas -o hello.o hello.s
[EMAIL PROTECTED]:/tmp 75% ld -o hello hello.o -lc
[EMAIL PROTECTED]:/tmp 76% ./hello
 hello, world
Segmentation Fault (core dumped)
[EMAIL PROTECTED]:/tmp 77% gcc -o hello hello.o -lc
[EMAIL PROTECTED]:/tmp 78% ./hello
 hello, world
[EMAIL PROTECTED]:/tmp 79%

- Bart

--
Bart Smaalders                  Solaris Kernel Performance
[EMAIL PROTECTED]               http://blogs.sun.com/barts
_______________________________________________
opensolaris-discuss mailing list
[email protected]

Reply via email to