site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:in-reply-to:references:mime-version:content-type:message-id:cc:content-transfer-encoding:from:subject:date:to:x-mailer; b=UVMwZ3NgS6Kh3DLQthSscCGbIHfAfvl3A3iU/b5+TTGF1UkLbj2BU5UIxLjJ3q8EJDRrgBfAL+GP8tvmChCd1QZ0fBESx6HJzKECWiR5318NxDJ+hdGVRZFz81KFke3VW/+EY4DSB9lu1aHFB9gUyf+xthyjy5hi0ZsWGoy4EK8= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:in-reply-to:references:mime-version:content-type:message-id:cc:content-transfer-encoding:from:subject:date:to:x-mailer; b=Ij9fImUvIk2wraDvRkR0lDcbTyE2pTaJVwY+N1GTcaa2gx0fUO05eTE81PVqJjr69+VZKO9N6FTZmguFx+LE+1FM8CdMKKIGLvPvDQCTW/8spG7GYk8mdC7S/S97xWNefvctP7e27wCzfsOo1P6w0XsEtCLZZ4FJ+sTL7JPjn68= My compiler outputs files for nasm so I compile them like this: nasm -fmacho hello.asm ld -o hello hello.o -lrts -L../build -e _start -lc So it links with libc. But, when I try to run it, I get: (gdb) disassemble dyld_stub_write Dump of assembler code for function dyld_stub_write: 0xa0011230 <dyld_stub_write+0>: jmp 0x900101b0 <write> End of assembler dump. (gdb) r Starting program: /Users/filcab/dev/compiladores/tests/hello Any clues? Thanks for the help Filipe Cabecinhas On 18 Mar, 2007, at 12:30, Jonas Maebe wrote: _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... I'm now trying to write the run-time library using libc (When I corrected the sysenter_trap it stopped doing system calls, so I tried this way) but I have another problem... This time with the linker. Program received signal EXC_BAD_INSTRUCTION, Illegal instruction/ operand. 0x00004005 in dyld_stub_write () (gdb) x /i $eip 0x4005 <dyld_stub_write>: hlt I'm guessing (maybe I'm wrong) that the dynamic linker isn't loading libc. In general, it's pretty easy to build your run time library on top of libc rather than on top of system calls (we also did it for Mac OS X, while our Linux version uses system calls because there system calls are pretty much guaranteed to be backwards compatible forever, while glibc breaks backwards binary compatibility every couple of years). This email sent to site_archiver@lists.apple.com
participants (1)
-
Filipe Cabecinhas