linux-assembly.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brian Raiter <breadbox@muppetlabs.com>
To: shm@nation.pl
Cc: linux-assembly@vger.kernel.org
Subject: Re: Problem with nasm
Date: Sat, 26 Mar 2005 15:50:31 -0800	[thread overview]
Message-ID: <16965.62791.870164.701108@eidolon.muppetlabs.com> (raw)
In-Reply-To: <4245D101.2050206@nation.pl>

> bash-2.05b# cat exit.s
> global _start:
> 
> _start:
>          xor ebx, ebx
>          mov eax, 1
>          int 80h
> 
> 
> $ uname -srp
> Linux 2.6.11-gentoo-r3 AMD Duron(tm) Processor

I tried your file (both with and without the erroneous colon) and it
worked fine. This was on a 2.4 Linux, however, using Nasm 0.98.38.

> bash-2.05b# nasm -f elf -o exit.o exit.s
> bash-2.05b# ld -o exit exit.o

Try compiling with "gcc -nostartfiles -o exit exit.o" instead, and see
if you get different results. If so, then gcc probably knows of some
extra arguments that ld needs to produce a proper executable. Whenever
feasible, you should let gcc do the linking for you instead of
invoking ld directly. ld can take a lot of cmdline arguments.

The "-nostartfiles" option will tell gcc not to supply a _start
routine, and not to link in the usual C libraries. You will probably
still get a slightly bigger executable than if you invoked ld
directly, but not by much.

b

  parent reply	other threads:[~2005-03-26 23:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-24 23:08 Unable to access memory address J.
2005-03-25  9:46 ` Frank Kotler
2005-03-26 11:18   ` J.
2005-03-26 21:15     ` Problem with nasm Mateusz Kocielski
2005-03-26 22:15       ` Frank Kotler
2005-03-26 23:50       ` Brian Raiter [this message]
2005-03-26 23:58         ` Mateusz Kocielski
2005-04-11  3:39 ` Bug in Gas? Randall Hyde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=16965.62791.870164.701108@eidolon.muppetlabs.com \
    --to=breadbox@muppetlabs.com \
    --cc=linux-assembly@vger.kernel.org \
    --cc=shm@nation.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).