public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Max Filippov <jcmvbkbc@gmail.com>
To: binutils@sourceware.org,	gdb-patches@sourceware.org
Cc: Sterling Augustine <augustine.sterling@gmail.com>,
	David Weatherford <weath@cadence.com>,
	Maxim Grigoriev <maxim2405@gmail.com>,
	Woody LaRue <larue@cadence.com>,
	Max Filippov <jcmvbkbc@gmail.com>
Subject: [RFC 3/5] xtensa: support dynconfig on windows
Date: Mon, 22 May 2017 21:12:00 -0000	[thread overview]
Message-ID: <1495487553-19078-4-git-send-email-jcmvbkbc@gmail.com> (raw)
In-Reply-To: <1495487553-19078-1-git-send-email-jcmvbkbc@gmail.com>

2017-05-22  Max Filippov  <jcmvbkbc@gmail.com>
bfd/
	* xtensa-config.c (windows.h): New #include'd header.
	(RTLD_LAZY): New macro definition.
	(dlopen, dlsym, dlclose, dlerror): New functions.
---
 bfd/xtensa-config.c | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/bfd/xtensa-config.c b/bfd/xtensa-config.c
index fdbcca4..3e12e26 100644
--- a/bfd/xtensa-config.c
+++ b/bfd/xtensa-config.c
@@ -3,6 +3,8 @@
 
 #if defined (HAVE_DLFCN_H)
 #include <dlfcn.h>
+#elif defined (HAVE_WINDOWS_H)
+#include <windows.h>
 #endif
 #include <stdio.h>
 #include <stdlib.h>
@@ -12,6 +14,37 @@
 
 static struct xtensa_config xtensa_defconfig = XTENSA_CONFIG_INITIALIZER;
 
+#if !defined (HAVE_DLFCN_H) && defined (HAVE_WINDOWS_H)
+
+#define RTLD_LAZY 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 GetProcAddress (handle, name);
+}
+
+static int ATTRIBUTE_UNUSED
+dlclose (void *handle)
+{
+  FreeLibrary (handle);
+  return 0;
+}
+
+static const char *
+dlerror (void)
+{
+  return "Unable to load DLL.";
+}
+
+#endif /* !defined (HAVE_DLFCN_H) && defined (HAVE_WINDOWS_H)  */
+
 void *xtensa_load_config (const char *name ATTRIBUTE_UNUSED, void *def)
 {
   static int init;
-- 
2.1.4

  reply	other threads:[~2017-05-22 21:12 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-22 21:12 [RFC 0/5] xtensa: support dynamic configuration Max Filippov
2017-05-22 21:12 ` Max Filippov [this message]
2017-06-12 15:45   ` [RFC 3/5] xtensa: support dynconfig on windows Nick Clifton
2017-05-22 21:12 ` [RFC 2/5] xtensa: make configuration dynamic Max Filippov
2017-05-26 18:10   ` augustine.sterling
2017-05-26 18:15     ` augustine.sterling
2017-06-06 12:53       ` Nick Clifton
2017-06-07 19:13         ` Max Filippov
2017-05-22 21:12 ` [RFC 1/5] xtensa: don't expect XCHAL_* macros to be constant Max Filippov
2017-05-26 17:36   ` augustine.sterling
2017-05-22 21:13 ` [RFC 5/5] gdb: xtensa: make tdep and linux-nat dynamically configurable Max Filippov
2017-05-22 21:13 ` [RFC 4/5] xtensa: make xtensa_modules dynamic Max Filippov
2017-06-12 15:49   ` Nick Clifton
2017-06-06 12:41 ` [RFC 0/5] xtensa: support dynamic configuration Nick Clifton
2017-06-07 19:23   ` Max Filippov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1495487553-19078-4-git-send-email-jcmvbkbc@gmail.com \
    --to=jcmvbkbc@gmail.com \
    --cc=augustine.sterling@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=gdb-patches@sourceware.org \
    --cc=larue@cadence.com \
    --cc=maxim2405@gmail.com \
    --cc=weath@cadence.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).