From 11ce65f5a0fa13b8b0262e3382cbd94ab67f814c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Mon, 22 Oct 2007 00:06:13 +0000 Subject: [PATCH] crt files for m68k. Synced with r22648. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22653 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/glue/arch/m68k/Jamfile | 7 +++++++ src/system/glue/arch/m68k/crti.S | 30 ++++++++++++++++++++++++++++++ src/system/glue/arch/m68k/crtn.S | 19 +++++++++++++++++++ 3 files changed, 56 insertions(+) create mode 100644 src/system/glue/arch/m68k/Jamfile create mode 100644 src/system/glue/arch/m68k/crti.S create mode 100644 src/system/glue/arch/m68k/crtn.S diff --git a/src/system/glue/arch/m68k/Jamfile b/src/system/glue/arch/m68k/Jamfile new file mode 100644 index 0000000000..7b1539dc47 --- /dev/null +++ b/src/system/glue/arch/m68k/Jamfile @@ -0,0 +1,7 @@ +SubDir HAIKU_TOP src system glue arch m68k ; + +KernelObjects + crti.S + crtn.S + ; + diff --git a/src/system/glue/arch/m68k/crti.S b/src/system/glue/arch/m68k/crti.S new file mode 100644 index 0000000000..1968449d12 --- /dev/null +++ b/src/system/glue/arch/m68k/crti.S @@ -0,0 +1,30 @@ +/* + * Copyright 2005, Axel Dörfler, axeld@pinc-software.de. + * Distributed under the terms of the MIT License. + */ + +/** This file contains the first part of the ".init" and ".fini" sections in + * the ELF executable. + * The functions defined here will be called during initialization/termination + * of the loaded executable/library. The ".init" and ".fini" sections are + * stacked together like this: + * + * crti.S entry point + * call to _init_before/_term_before + * crtbegin.S GCC specific: constructors/destructors are called, ... + * crtend.S + * crtn.S call to _init_after/_term_after + * exit + */ + +#define FUNCTION(x) .global x; .type x,@function; x + +.section .init +FUNCTION(_init): + jsr _init_before + // crtbegin.o stuff comes here + +.section .fini +FUNCTION(_fini): + jsr _term_before + // crtbegin.o stuff comes here diff --git a/src/system/glue/arch/m68k/crtn.S b/src/system/glue/arch/m68k/crtn.S new file mode 100644 index 0000000000..bdfbb5bc51 --- /dev/null +++ b/src/system/glue/arch/m68k/crtn.S @@ -0,0 +1,19 @@ +/* + * Copyright 2005, Axel Dörfler, axeld@pinc-software.de. + * Distributed under the terms of the MIT License. + */ + +/** This file contains the final part of the ".init" and ".fini" sections in + * the ELF executable. It is tightly connected to crti.S. + * Have a look at crti.S to find a description of what happens here. + */ + +.section .init + // the image ID and program args are still on the stack + jsr _init_after + rts + +.section .fini + // the image ID and program args are still on the stack + jsr _term_after + rts