Prechádzať zdrojové kódy

--- Merging r23846 into '.':
U rtl/netbsd/Makefile.fpc
A rtl/netbsd/i386/dllprt0.as
A rtl/netbsd/x86_64/dllprt0.as

# revisions: 23846
r23846 | pierre | 2013-03-15 17:07:25 +0100 (Fri, 15 Mar 2013) | 1 line
Changed paths:
M /trunk/rtl/netbsd/Makefile.fpc
A /trunk/rtl/netbsd/i386/dllprt0.as
A /trunk/rtl/netbsd/x86_64/dllprt0.as

+ Added dllprt0.as fro netbsd

git-svn-id: branches/fixes_2_6@25221 -

marco 12 rokov pred
rodič
commit
0d46236096

+ 2 - 0
.gitattributes

@@ -7765,6 +7765,7 @@ rtl/netbsd/errno.inc svneol=native#text/plain
 rtl/netbsd/errnostr.inc svneol=native#text/plain
 rtl/netbsd/i386/bsyscall.inc svneol=native#text/plain
 rtl/netbsd/i386/cprt0.as svneol=native#text/plain
+rtl/netbsd/i386/dllprt0.as svneol=native#text/plain
 rtl/netbsd/i386/prt0.as svneol=native#text/plain
 rtl/netbsd/i386/prt0_10.as svneol=native#text/plain
 rtl/netbsd/i386/sighnd.inc svneol=native#text/plain
@@ -7792,6 +7793,7 @@ rtl/netbsd/unxsockh.inc svneol=native#text/plain
 rtl/netbsd/unxsysc.inc svneol=native#text/plain
 rtl/netbsd/x86_64/bsyscall.inc svneol=native#text/plain
 rtl/netbsd/x86_64/cprt0.as svneol=native#text/plain
+rtl/netbsd/x86_64/dllprt0.as svneol=native#text/plain
 rtl/netbsd/x86_64/gprt0.as svneol=native#text/plain
 rtl/netbsd/x86_64/prt0.as svneol=native#text/plain
 rtl/netbsd/x86_64/sighnd.inc svneol=native#text/plain

+ 4 - 1
rtl/netbsd/Makefile.fpc

@@ -9,7 +9,7 @@ main=rtl
 fpcpackage=y
 
 [target]
-loaders=prt0 cprt0
+loaders=prt0 cprt0 dllprt0
 units=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 \
       strings syscall sysctl  baseunix unixutil \
       unix rtlconsts initc cmem matrix \
@@ -121,6 +121,9 @@ prt0$(OEXT) : $(CPU_TARGET)/$(PRT0).as
 cprt0$(OEXT) : $(CPU_TARGET)/cprt0.as
         $(AS) -o $(UNITTARGETDIRPREFIX)cprt0$(OEXT) $(CPU_TARGET)/cprt0.as
 
+dllprt0$(OEXT) : $(CPU_TARGET)/dllprt0.as
+        $(AS) -o $(UNITTARGETDIRPREFIX)dllprt0$(OEXT) $(CPU_TARGET)/dllprt0.as
+
 #
 # System Units (System, Objpas, Strings)
 #

+ 1 - 0
rtl/netbsd/i386/dllprt0.as

@@ -0,0 +1 @@
+.include "i386/cprt0.as"

+ 52 - 0
rtl/netbsd/x86_64/dllprt0.as

@@ -0,0 +1,52 @@
+	.file	"crt0.c"
+	.globl	__progname
+	.section	.rodata
+.LC0:
+	.string	""
+	.data
+	.align 8
+	.type	__progname, @object
+	.size	__progname, 8
+__progname:
+	.quad	.LC0
+	.text 
+        .p2align 2,0x90
+
+.globl _haltproc
+.type _haltproc,@function
+
+_haltproc:
+           movq $1,%rax
+           movzwq operatingsystem_result(%rip),%rbx
+           pushq   %rbx
+           call .Lactualsyscall
+           addq  $8,%rsp
+           jmp   _haltproc
+
+.Lactualsyscall:
+         int $0x80
+         jb .LErrorcode
+         xor %rbx,%rbx
+         ret
+.LErrorcode:
+	movl	%eax, %edi
+
+# This section is needed for NetBSD to recognize a NetBSD binary as such.
+# otherwise it will be startup in Linux emulation mode.
+
+.section ".note.netbsd.ident","a"
+.p2align 2
+
+.long 7
+.long 4
+# ELF NOTE TYPE NETBSD TAG
+.long 1
+.ascii "NetBSD\0\0"
+.long 199905
+
+	.comm	environ,8,8
+	.comm	__progname_storage,256,32
+        .comm   operatingsystem_parameter_envp,8,8
+        .comm   operatingsystem_parameter_argc,8,8
+        .comm   operatingsystem_parameter_argv,8,8
+