Re: Executable entry point
Re: Executable entry point
- Subject: Re: Executable entry point
- From: Filipe Cabecinhas <email@hidden>
- Date: Mon, 19 Mar 2007 16:24:15 +0000
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.
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
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.
Any clues?
Thanks for the help
Filipe Cabecinhas
On 18 Mar, 2007, at 12:30, Jonas Maebe wrote:
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).
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden