Lines 1-6
Link Here
|
1 |
// plugin.cc -- plugin manager for gold -*- C++ -*- |
1 |
// plugin.cc -- plugin manager for gold -*- C++ -*- |
2 |
|
2 |
|
3 |
// Copyright 2008, 2009, 2010, 2011 Free Software Foundation, Inc. |
3 |
// Copyright 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc. |
4 |
// Written by Cary Coutant <ccoutant@google.com>. |
4 |
// Written by Cary Coutant <ccoutant@google.com>. |
5 |
|
5 |
|
6 |
// This file is part of gold. |
6 |
// This file is part of gold. |
Lines 29-37
Link Here
|
29 |
#include <vector> |
29 |
#include <vector> |
30 |
|
30 |
|
31 |
#ifdef ENABLE_PLUGINS |
31 |
#ifdef ENABLE_PLUGINS |
|
|
32 |
#ifdef HAVE_DLFCN_H |
32 |
#include <dlfcn.h> |
33 |
#include <dlfcn.h> |
|
|
34 |
#elif defined (HAVE_WINDOWS_H) |
35 |
#include <windows.h> |
36 |
#else |
37 |
#error Unknown how to handle dynamic-load-libraries. |
33 |
#endif |
38 |
#endif |
34 |
|
39 |
|
|
|
40 |
#if !defined (HAVE_DLFCN_H) && defined (HAVE_WINDOWS_H) |
41 |
|
42 |
#define RTLD_NOW 0 /* Dummy value. */ |
43 |
static void * |
44 |
dlopen(const char *file, int mode ATTRIBUTE_UNUSED) |
45 |
{ |
46 |
return LoadLibrary(file); |
47 |
} |
48 |
|
49 |
static void * |
50 |
dlsym(void *handle, const char *name) |
51 |
{ |
52 |
return reinterpret_cast<void *>( |
53 |
GetProcAddress(static_cast<HMODULE>(handle),name)); |
54 |
} |
55 |
|
56 |
static const char * |
57 |
dlerror(void) |
58 |
{ |
59 |
return "unable to load dll"; |
60 |
} |
61 |
|
62 |
#endif /* !defined (HAVE_DLFCN_H) && defined (HAVE_WINDOWS_H) */ |
63 |
#endif /* ENABLE_PLUGINS */ |
64 |
|
35 |
#include "parameters.h" |
65 |
#include "parameters.h" |
36 |
#include "errors.h" |
66 |
#include "errors.h" |
37 |
#include "fileread.h" |
67 |
#include "fileread.h" |