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/ - To unsubscribe from this list: send the line "unsubscribe linux-assembly" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
