From 51c706f70c909cdb34c6bb6aaf8b2d09762f090b Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Tue, 12 May 2009 21:01:26 +0000 Subject: [PATCH] Added variables to the glue code that identify the Haiku version and ABI. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30728 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/system/image_defs.h | 18 ++++++++++++++++++ src/system/glue/init_term_dyn.c | 10 +++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 headers/private/system/image_defs.h diff --git a/headers/private/system/image_defs.h b/headers/private/system/image_defs.h new file mode 100644 index 0000000000..5247118080 --- /dev/null +++ b/headers/private/system/image_defs.h @@ -0,0 +1,18 @@ +/* + * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de. + * Distributed under the terms of the MIT License. + */ +#ifndef _SYSTEM_IMAGE_DEFS_H +#define _SYSTEM_IMAGE_DEFS_H + +#include + + +#define B_SHARED_OBJECT_HAIKU_VERSION_VARIABLE _gSharedObjectHaikuVersion +#define B_SHARED_OBJECT_HAIKU_VERSION_VARIABLE_NAME "_gSharedObjectHaikuVersion" + +#define B_SHARED_OBJECT_HAIKU_ABI_VARIABLE _gSharedObjectHaikuABI +#define B_SHARED_OBJECT_HAIKU_ABI_VARIABLE_NAME "_gSharedObjectHaikuABI" + + +#endif /* _SYSTEM_IMAGE_DEFS_H */ diff --git a/src/system/glue/init_term_dyn.c b/src/system/glue/init_term_dyn.c index 5743ab9adc..a531ee2b7c 100644 --- a/src/system/glue/init_term_dyn.c +++ b/src/system/glue/init_term_dyn.c @@ -3,13 +3,21 @@ * Distributed under the terms of the MIT License. */ - #include #include +#include #include "init_term_dyn.h" +// Haiku API and ABI versions -- we compile those into shared objects so that +// the runtime loader can discriminate the versions and enable compatibility +// work-arounds, if necessary. + +uint32 B_SHARED_OBJECT_HAIKU_VERSION_VARIABLE = B_HAIKU_VERSION; +uint32 B_SHARED_OBJECT_HAIKU_ABI_VARIABLE = B_HAIKU_ABI; + + /** These functions are called from _init()/_fini() (in crti.S, crtn.S) * _init/_term_before() is called before crtbegin/end code is executed, * _init/_term_after() after this.