Re: Problem with nasm

Mateusz Kocielski <[email protected]>
Newsgroups org.kernel.vger.linux-assembly
Message-ID <[email protected]>
Brian Raiter wrote:

> 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.

$ nasm -felf -o exit.o exit.s
$ gcc -nostartfiles -o exit exit.o
$ strace ./exit
.
.
.
_exit(0)                                = ?

It works ok, thank you very much.

-- 
Shm - shm ( at ) irc7 ( dot ) pl
EKG: 2099452  JID: [email protected]
homepage : http://shm.nation.pl/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.