From a8bd76eb3f9446a6a7c2e7013158b81c2676ebb0 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Sun, 6 Mar 2005 16:49:13 +0000 Subject: [PATCH] Required for the build under Linux. Defines dl_iterate_phdr() which is a Linux specific glibc dependency. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11604 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/build/cpp_support.cpp | 51 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 src/build/cpp_support.cpp diff --git a/src/build/cpp_support.cpp b/src/build/cpp_support.cpp new file mode 100644 index 0000000000..ea13125526 --- /dev/null +++ b/src/build/cpp_support.cpp @@ -0,0 +1,51 @@ +/* + * Copyright 2005, Ingo Weinhold, bonefish@users.sf.net. + * Distributed under the terms of the MIT License. + */ + +#include + +struct dl_phdr_info; + +extern "C" int dl_iterate_phdr(int (*callback)(struct dl_phdr_info *info, size_t size, + void *data), void *data); + +#if defined(_BOOT_MODE) || defined(_KERNEL_MODE) + + +// compiled into the kernel/boot loader + +#include "KernelExport.h" + +int +dl_iterate_phdr(int (*callback)(struct dl_phdr_info *info, size_t size, + void *data), void *data) +{ + // This function should never be called, since it is only needed when + // exception are used, and we don't do that in the kernel. Hence we + // don't need to implement it. + panic("dl_iterate_phdr() called\n"); + + return 0; +} + + +#else // !( defined(_BOOT_MODE) || defined(_KERNEL_MODE) ) + + +// compiled into libroot.so (well, not yet) + +//#include + +int +dl_iterate_phdr(int (*callback)(struct dl_phdr_info *info, size_t size, + void *data), void *data) +{ + // TODO: Here we need to implement the function, since we want exceptions + // in userland. + + return 0; +} + + +#endif