From 8b2fa4d23cce33476d5d84bd5c55908964380059 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Wed, 26 Jan 2005 18:20:13 +0000 Subject: [PATCH] Added crti/n files for PPC - not tested, but they even might work. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11072 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/glue/arch/ppc/Jamfile | 7 +++++++ src/kernel/glue/arch/ppc/crti.S | 30 ++++++++++++++++++++++++++++++ src/kernel/glue/arch/ppc/crtn.S | 19 +++++++++++++++++++ 3 files changed, 56 insertions(+) create mode 100644 src/kernel/glue/arch/ppc/Jamfile create mode 100644 src/kernel/glue/arch/ppc/crti.S create mode 100644 src/kernel/glue/arch/ppc/crtn.S diff --git a/src/kernel/glue/arch/ppc/Jamfile b/src/kernel/glue/arch/ppc/Jamfile new file mode 100644 index 0000000000..a73941e2d0 --- /dev/null +++ b/src/kernel/glue/arch/ppc/Jamfile @@ -0,0 +1,7 @@ +SubDir OBOS_TOP src kernel glue arch ppc ; + +KernelObjects + crti.S + crtn.S + ; + diff --git a/src/kernel/glue/arch/ppc/crti.S b/src/kernel/glue/arch/ppc/crti.S new file mode 100644 index 0000000000..e463c4dc8c --- /dev/null +++ b/src/kernel/glue/arch/ppc/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): + bl _init_before + // crtbegin.o stuff comes here + +.section .fini +FUNCTION(_fini): + bl _term_before + // crtbegin.o stuff comes here diff --git a/src/kernel/glue/arch/ppc/crtn.S b/src/kernel/glue/arch/ppc/crtn.S new file mode 100644 index 0000000000..c00a1c0f37 --- /dev/null +++ b/src/kernel/glue/arch/ppc/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 + bl _init_after + blr + +.section .fini + // the image ID and program args are still on the stack + bl _term_after + blr