linux-assembly.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* ld error
@ 2002-05-27  7:19 G Anna
  2002-05-27 18:27 ` Alfred Cleve
  0 siblings, 1 reply; 8+ messages in thread
From: G Anna @ 2002-05-27  7:19 UTC (permalink / raw)
  To: linux-assembly

Dear All,

I am working through 'Linux Assembly "Hello World" Tutorial, CS 200'
by Bjorn Chambless.  But I am unable to compile the program given in
that.  Kindly help me. 

For your convenience I have included the assembly program at the end
of this mail.

average.s is the relevant assembly program file.

$ as -a --gstabs -o average.o average.s

$ ld -m elf_i386 -static /usr/lib/crt1.o /usr/lib/crti.o -lc average.o
                              /usr/lib/crtn.o

/usr/lib/libc.a(strtoll.o): In function `__strtoll_internal':
/usr/src/bs/BUILD/glibc-2.2.2/stdlib/../sysdeps/generic/strtol.c:386: undefined reference to `__udivdi3'
/usr/src/bs/BUILD/glibc-2.2.2/stdlib/../sysdeps/generic/strtol.c:387: undefined reference to `__umoddi3'
/usr/lib/libc.a(strtoull.o): In function `__strtoull_internal':
/usr/src/bs/BUILD/glibc-2.2.2/stdlib/../sysdeps/generic/strtol.c:386: undefined reference to `__udivdi3'
/usr/src/bs/BUILD/glibc-2.2.2/stdlib/../sysdeps/generic/strtol.c:387: undefined reference to `__umoddi3'

$ cat average.s
.data   

	.type hi_temp,@object  
        .size hi_temp,1       
hi_temp:
        .byte 0x92      

        .type lo_temp,@object
        .size lo_temp,1
lo_temp:
        .byte 0x52

        .type av_temp,@object
        .size av_temp,1
av_temp:
        .byte 0

.text
        .align 4        
.globl main            
        .type main,@function    

main:
        pushl %ebp      
        movl %esp,%ebp 
        movb hi_temp,%al
        addb lo_temp,%al
        movb $0,%ah
        adcb $0,%ah
        movb $2,%bl
        idivb %bl
        movb %al,av_temp
        leave           
        ret            

$ as --version
GNU assembler 2.10.91
Copyright 2001 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License.  This program has absolutely no warranty.
This assembler was configured for a target of `i386-redhat-linux'.

$ ld --version
GNU ld 2.10.91
Copyright 2001 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License.  This program has absolutely no warranty.
  Supported emulations:
   elf_i386
   i386linux
   elf_i386_glibc21

$ gcc --version
2.96

$ uname -a
Linux wobble 2.4.16 #8 Tue May 14 14:15:58 IST 2002 i686 unknown

$ cat /etc/issue

Red Hat Linux release 7.1 (Seawolf)
Kernel 2.4.16 on an i686

Hope somebody will help me with this.

Thank you.

Cheers,
anna

-- 

(15) I will never employ any device with a digital countdown. If I find
     that  such  a  device  is absolutely unavoidable, I will set it to
     activate when the counter reaches 117 and the hero is just putting
     his plan into operation. - Peter Anspach in "The Top 100 Things 
     I'd Do If I Ever Became An Evil Overlord"

                                            http://www.eviloverlord.com



^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: ld error
@ 2002-05-27 18:58 Emmet Ford
  2002-05-28  1:51 ` Brian Raiter
  0 siblings, 1 reply; 8+ messages in thread
From: Emmet Ford @ 2002-05-27 18:58 UTC (permalink / raw)
  To: linux-assembly

 > a readable tutorial to the "gas"-assembler.

You wander along a lightly trodden path. Here is what I have...

Linux Assembly Tutorial (nice)
http://www.geocities.com/SiliconValley/Ridge/2544/asm/linux-asm.txt

Using Assembly Language in Linux
http://linuxassembly.org/linasm.html

int80h.org -- Unix Assembly Language Programming
http://www.int80h.org/

http://www.gnu.org/manual/gas-2.9.1/as.html
Using as - Table of Contents - GNU Project - Free Software Foundation (FSF)

A Whirlwind Tutorial on Creating Really Teensy ELF Executables for Linux
http://members.tripod.de/linux_progz/docs/teensy.html

Linux 4k intro page
http://ma.verick.co.za/linux4k/

--Emmet Ford



-------- Original Message --------
Subject: Re: ld error
Date: Mon, 27 May 2002 20:27:52 +0200
From: Alfred.Cleve@t-online.de (Alfred Cleve)
To: linux-assembly@vger.kernel.org
References: <m3r8jygir3.fsf@wobble.eth.net>

Hi,

 > I am working through 'Linux Assembly "Hello World" Tutorial, CS 200'
 > by Bjorn Chambless.  But I am unable to compile the program given in
 > that.  Kindly help me.

i suspect that exercise isn't a simple "hello world"-program. It seems 
to me
as a nasty trap for lazy students :-))

The module "average" is a subroutine e.g. a "function" which should be 
linked
to a given C-Program.

For my first step i'm looking for a readable tutorial to the 
"gas"-assembler.

Have you seen anything in the web ?

Thanks,
Alfred


-- 
Alfred Cleve
Karbener Str. 7
61130 Nidderau-Heldenbergen
Germany
Phone +49-6187-901095
-
To unsubscribe from this list: send the line "unsubscribe linux-assembly" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2002-05-28 14:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-05-27  7:19 ld error G Anna
2002-05-27 18:27 ` Alfred Cleve
2002-05-28  5:27   ` G Anna
2002-05-28 11:26     ` Brian Raiter
2002-05-28 14:32       ` Robert Plantz
2002-05-28 12:54     ` J.S.Souza
  -- strict thread matches above, loose matches on Subject: below --
2002-05-27 18:58 Emmet Ford
2002-05-28  1:51 ` Brian Raiter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).