Gentoo Logo
Gentoo Spaceship




Note: Due to technical difficulties, the Archives are currently not up to date. GMANE provides an alternative service for most mailing lists.
c.f. bug 424647
List Archive: gentoo-sparc
Navigation:
Lists: gentoo-sparc: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-sparc@g.o
From: Alex Buell <alex.buell@...>
Subject: Why is a simple hello world in 64 bit assembly program 65k bytes long?
Date: Tue, 2 Jan 2007 21:40:01 +0000
My code:
.equ SYSCALL_EXIT, 1
.equ SYSCALL_WRITE, 4

.equ STDIN, 0
.equ STDOUT, 1
.equ STDERR, 2

        .align 4
        .global _start

_start:
        mov STDOUT, %o0
        set string, %o1
        mov 14, %o2
        mov SYSCALL_WRITE, %g1
        ta 0x10

        mov 0, %o0
        mov SYSCALL_EXIT, %g1
        ta 0x10

        .align 4

string:
.ascii  "Hello world!\n"

How I build it:
as -64 -o hello.o hello.s
ld -e _start --oformat=elf64-sparc -o hello hello.o
ld: warning: sparc:v9 architecture of input file `hello.o' is
incompatible with sparc output strip hello

file hello
hello: ELF 64-bit MSB executable, SPARC V9, version 1 (SYSV),
statically linked, stripped

ls -l
total 24
-rwxr-xr-x 1 root root 66032 2006-12-26 14:39 hello
-rw-r--r-- 1 root root  1056 2006-12-26 14:39 hello.o
-rw-r--r-- 1 root root   296 2006-12-25 10:07 hello.s
-rw-r--r-- 1 root root   187 2006-12-25 10:27 Makefile

Why is the hello executable 66,032 bytes long?
-- 
http://www.munted.org.uk

Fearsome grindings.
-- 
gentoo-sparc@g.o mailing list


Replies:
Re: Why is a simple hello world in 64 bit assembly program 65k bytes long?
-- Hamish Greig
Navigation:
Lists: gentoo-sparc: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
Why is a simple hello world in 64 bit assembly program 65k bytes long?
Next by thread:
Re: Why is a simple hello world in 64 bit assembly program 65k bytes long?
Previous by date:
Re: Booting Sun ultra sparc 60 with "own" kernel.
Next by date:
Re: Java Support on Sparc plattform.


Updated Jun 17, 2009

Summary: Archive of the gentoo-sparc mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.