Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 351855f

Browse files
committed
Remove obsolete linux dynloader code
This has been obsolete probably since the late 1990s.
1 parent b5d2929 commit 351855f

File tree

6 files changed

+6
-144
lines changed

6 files changed

+6
-144
lines changed

configure

+1-1
Original file line numberDiff line numberDiff line change
@@ -12495,7 +12495,7 @@ $as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h
1249512495
fi
1249612496

1249712497

12498-
for ac_header in atomic.h crypt.h dld.h fp_class.h getopt.h ieeefp.h ifaddrs.h langinfo.h mbarrier.h poll.h sys/epoll.h sys/ipc.h sys/prctl.h sys/procctl.h sys/pstat.h sys/resource.h sys/select.h sys/sem.h sys/shm.h sys/sockio.h sys/tas.h sys/un.h termios.h ucred.h utime.h wchar.h wctype.h
12498+
for ac_header in atomic.h crypt.h fp_class.h getopt.h ieeefp.h ifaddrs.h langinfo.h mbarrier.h poll.h sys/epoll.h sys/ipc.h sys/prctl.h sys/procctl.h sys/pstat.h sys/resource.h sys/select.h sys/sem.h sys/shm.h sys/sockio.h sys/tas.h sys/un.h termios.h ucred.h utime.h wchar.h wctype.h
1249912499
do :
1250012500
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
1250112501
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"

configure.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -1260,7 +1260,7 @@ AC_SUBST(UUID_LIBS)
12601260

12611261
AC_HEADER_STDBOOL
12621262

1263-
AC_CHECK_HEADERS([atomic.h crypt.h dld.h fp_class.h getopt.h ieeefp.h ifaddrs.h langinfo.h mbarrier.h poll.h sys/epoll.h sys/ipc.h sys/prctl.h sys/procctl.h sys/pstat.h sys/resource.h sys/select.h sys/sem.h sys/shm.h sys/sockio.h sys/tas.h sys/un.h termios.h ucred.h utime.h wchar.h wctype.h])
1263+
AC_CHECK_HEADERS([atomic.h crypt.h fp_class.h getopt.h ieeefp.h ifaddrs.h langinfo.h mbarrier.h poll.h sys/epoll.h sys/ipc.h sys/prctl.h sys/procctl.h sys/pstat.h sys/resource.h sys/select.h sys/sem.h sys/shm.h sys/sockio.h sys/tas.h sys/un.h termios.h ucred.h utime.h wchar.h wctype.h])
12641264

12651265
# On BSD, test for net/if.h will fail unless sys/socket.h
12661266
# is included first.

src/backend/port/dynloader/linux.c

+4-130
Original file line numberDiff line numberDiff line change
@@ -1,133 +1,7 @@
1-
/*-------------------------------------------------------------------------
1+
/*
2+
* src/backend/port/dynloader/linux.c
23
*
3-
* linux.c
4-
* Dynamic Loader for Postgres for Linux, generated from those for
5-
* Ultrix.
4+
* Dummy file used for nothing at this point
65
*
7-
* You need to install the dld library on your Linux system!
8-
*
9-
* Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
10-
* Portions Copyright (c) 1994, Regents of the University of California
11-
*
12-
*
13-
* IDENTIFICATION
14-
* src/backend/port/dynloader/linux.c
15-
*
16-
*-------------------------------------------------------------------------
6+
* see linux.h
177
*/
18-
19-
#include "postgres.h"
20-
21-
#ifdef HAVE_DLD_H
22-
#include <dld.h>
23-
#endif
24-
25-
#include "dynloader.h"
26-
#include "miscadmin.h"
27-
28-
29-
#ifndef HAVE_DLOPEN
30-
31-
void *
32-
pg_dlopen(const char *filename)
33-
{
34-
#ifndef HAVE_DLD_H
35-
elog(ERROR, "dynamic load not supported");
36-
return NULL;
37-
#else
38-
static int dl_initialized = 0;
39-
40-
/*
41-
* initializes the dynamic loader with the executable's pathname. (only
42-
* needs to do this the first time pg_dlopen is called.)
43-
*/
44-
if (!dl_initialized)
45-
{
46-
if (dld_init(dld_find_executable(my_exec_path)))
47-
return NULL;
48-
49-
/*
50-
* if there are undefined symbols, we want dl to search from the
51-
* following libraries also.
52-
*/
53-
dl_initialized = 1;
54-
}
55-
56-
/*
57-
* link the file, then check for undefined symbols!
58-
*/
59-
if (dld_link(filename))
60-
return NULL;
61-
62-
/*
63-
* If undefined symbols: try to link with the C and math libraries! This
64-
* could be smarter, if the dynamic linker was able to handle shared libs!
65-
*/
66-
if (dld_undefined_sym_count > 0)
67-
{
68-
if (dld_link("/usr/lib/libc.a"))
69-
{
70-
elog(WARNING, "could not link C library");
71-
return NULL;
72-
}
73-
if (dld_undefined_sym_count > 0)
74-
{
75-
if (dld_link("/usr/lib/libm.a"))
76-
{
77-
elog(WARNING, "could not link math library");
78-
return NULL;
79-
}
80-
if (dld_undefined_sym_count > 0)
81-
{
82-
int count = dld_undefined_sym_count;
83-
char **list = dld_list_undefined_sym();
84-
85-
/* list the undefined symbols, if any */
86-
do
87-
{
88-
elog(WARNING, "\"%s\" is undefined", *list);
89-
list++;
90-
count--;
91-
} while (count > 0);
92-
93-
dld_unlink_by_file(filename, 1);
94-
return NULL;
95-
}
96-
}
97-
}
98-
99-
return (void *) strdup(filename);
100-
#endif
101-
}
102-
103-
PGFunction
104-
pg_dlsym(void *handle, const char *funcname)
105-
{
106-
#ifndef HAVE_DLD_H
107-
return NULL;
108-
#else
109-
return (PGFunction) dld_get_func((funcname));
110-
#endif
111-
}
112-
113-
void
114-
pg_dlclose(void *handle)
115-
{
116-
#ifndef HAVE_DLD_H
117-
#else
118-
dld_unlink_by_file(handle, 1);
119-
free(handle);
120-
#endif
121-
}
122-
123-
char *
124-
pg_dlerror(void)
125-
{
126-
#ifndef HAVE_DLD_H
127-
return "dynaloader unsupported";
128-
#else
129-
return dld_strerror(dld_errno);
130-
#endif
131-
}
132-
133-
#endif /* !HAVE_DLOPEN */

src/backend/port/dynloader/linux.h

-6
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,7 @@
1515
#define PORT_PROTOS_H
1616

1717
#include "utils/dynamic_loader.h" /* pgrminclude ignore */
18-
#ifdef HAVE_DLOPEN
1918
#include <dlfcn.h>
20-
#endif
21-
22-
23-
#ifdef HAVE_DLOPEN
2419

2520
/*
2621
* In some older systems, the RTLD_NOW flag isn't defined and the mode
@@ -39,6 +34,5 @@
3934
#define pg_dlsym dlsym
4035
#define pg_dlclose dlclose
4136
#define pg_dlerror dlerror
42-
#endif /* HAVE_DLOPEN */
4337

4438
#endif /* PORT_PROTOS_H */

src/include/pg_config.h.in

-3
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,6 @@
186186
don't. */
187187
#undef HAVE_DECL_VSNPRINTF
188188

189-
/* Define to 1 if you have the <dld.h> header file. */
190-
#undef HAVE_DLD_H
191-
192189
/* Define to 1 if you have the `dlopen' function. */
193190
#undef HAVE_DLOPEN
194191

src/include/pg_config.h.win32

-3
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,6 @@
143143
don't. */
144144
#define HAVE_DECL_VSNPRINTF 1
145145

146-
/* Define to 1 if you have the <dld.h> header file. */
147-
/* #undef HAVE_DLD_H */
148-
149146
/* Define to 1 if you have the `dlopen' function. */
150147
/* #undef HAVE_DLOPEN */
151148

0 commit comments

Comments
 (0)