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

Lab manual for SPARC



Hi,

I got that Laboratory Manual for SPARC and found the debian package for
tkisem. How can I build from assembler to execute on my machine?  

Have I missed something or do I need another book :(


I can build the example foo.s  and load and run foo in tkisem OK thus:
$ as -als -o foo.o foo.s
$ ld -m sun4 -o foo foo.o

tkisem loads and runs as expected.

Now I would like run the program foo on my sunblade 100
$ uname -u
Linux sun 2.4.24-sparc64 #1 Fri Jan 30 18:32:22 EST 2004 sparc64 GNU/Linu

The foo for iesm I guess sshould not run:
$ file foo
foo: sparc demand paged executable not stripped
$ foo
-bash: ./foo: cannot execute binary file

I try this:
$ ld -e start -m elf32_sparc -o foo foo.o
ld: warning: cannot find entry symbol start; defaulting to 0000000000010074

$ file foo
foo: ELF 32-bit MSB executable, SPARC, version 1 (SYSV), statically linked,
not stripped

$ ./foo
jim@sun:~$ ./foo
Segmentation fault


Here was the as output
<snip>
SPARC GAS  foo.s                        page 2


DEFINED SYMBOLS
               foo.s:2      .data:0000000000000000 x
               foo.s:3      .data:0000000000000004 y
               foo.s:4      .data:0000000000000008 z
               foo.s:7      .text:0000000000000000 start
               foo.s:17     .text:000000000000002c end

thanks

jim



Reply to: