summaryrefslogtreecommitdiffstats
path: root/binutils-2.21/gold/plugin.cc
diff options
context:
space:
mode:
Diffstat (limited to 'binutils-2.21/gold/plugin.cc')
-rw-r--r--binutils-2.21/gold/plugin.cc30
1 files changed, 30 insertions, 0 deletions
diff --git a/binutils-2.21/gold/plugin.cc b/binutils-2.21/gold/plugin.cc
index 8ce152c..aab0410 100644
--- a/binutils-2.21/gold/plugin.cc
+++ b/binutils-2.21/gold/plugin.cc
@@ -29,9 +29,39 @@
#include <vector>
#ifdef ENABLE_PLUGINS
+#ifdef HAVE_DLFCN_H
#include <dlfcn.h>
+#elif defined (HAVE_WINDOWS_H)
+#include <windows.h>
+#else
+#error Unknown how to handle dynamic-load-libraries.
#endif
+#if !defined (HAVE_DLFCN_H) && defined (HAVE_WINDOWS_H)
+
+#define RTLD_NOW 0 /* Dummy value. */
+static void *
+dlopen(const char *file, int mode ATTRIBUTE_UNUSED)
+{
+ return LoadLibrary(file);
+}
+
+static void *
+dlsym(void *handle, const char *name)
+{
+ return reinterpret_cast<void *>(
+ GetProcAddress(static_cast<HMODULE>(handle),name));
+}
+
+static const char *
+dlerror(void)
+{
+ return "unable to load dll";
+}
+
+#endif /* !defined (HAVE_DLFCN_H) && defined (HAVE_WINDOWS_H) */
+#endif /* ENABLE_PLUGINS */
+
#include "parameters.h"
#include "errors.h"
#include "fileread.h"