From 4ba7f1c0ed82acc1da16889819c2f9d0f67a204a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Sundstr=C3=B6m?= Date: Sun, 3 May 2009 22:26:23 +0000 Subject: [PATCH] Staking out some more mipsel ground. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30620 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/glue/arch/mipsel/Jamfile | 7 +++++ src/system/glue/arch/mipsel/crti.S | 42 +++++++++++++++++++++++++++++ src/system/glue/arch/mipsel/crtn.S | 29 ++++++++++++++++++++ 3 files changed, 78 insertions(+) create mode 100644 src/system/glue/arch/mipsel/Jamfile create mode 100644 src/system/glue/arch/mipsel/crti.S create mode 100644 src/system/glue/arch/mipsel/crtn.S diff --git a/src/system/glue/arch/mipsel/Jamfile b/src/system/glue/arch/mipsel/Jamfile new file mode 100644 index 0000000000..e40973ab13 --- /dev/null +++ b/src/system/glue/arch/mipsel/Jamfile @@ -0,0 +1,7 @@ +SubDir HAIKU_TOP src system glue arch mipsel ; + +KernelObjects + crti.S + crtn.S + ; + diff --git a/src/system/glue/arch/mipsel/crti.S b/src/system/glue/arch/mipsel/crti.S new file mode 100644 index 0000000000..a52b33dc5b --- /dev/null +++ b/src/system/glue/arch/mipsel/crti.S @@ -0,0 +1,42 @@ +/* + * Copyright 2009, Axel Dörfler, axeld@pinc-software.de. + * Distributed under the terms of the MIT License. + * + * Authors: + * Axel Dörfler, axeld@pinc-software.de + * Jonas Sundström, jonas@kirilla.se + */ + +/** 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 + +#warning MIPSEL: fixme + +.section .init +FUNCTION(_init): + .set noreorder + jal _init_before + nop + .set reorder + // crtbegin.o stuff comes here + +.section .fini +FUNCTION(_fini): + .set noreorder + jal _term_before + nop + .set reorder + // crtbegin.o stuff comes here diff --git a/src/system/glue/arch/mipsel/crtn.S b/src/system/glue/arch/mipsel/crtn.S new file mode 100644 index 0000000000..754632262e --- /dev/null +++ b/src/system/glue/arch/mipsel/crtn.S @@ -0,0 +1,29 @@ +/* + * Copyright 2009, Axel Dörfler, axeld@pinc-software.de. + * Distributed under the terms of the MIT License. + * + * Authors: + * Axel Dörfler, axeld@pinc-software.de + * Jonas Sundström, jonas@kirilla.se + */ + +/** 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. + */ + +#warning MIPSEL: fixme + +.section .init + // the image ID and program args are still on the stack + .set noreorder + jal _init_after + nop + .set reorder + +.section .fini + // the image ID and program args are still on the stack + .set noreorder + jal _term_after + nop + .set reorder