Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc87bc77

Browse files
committed
Use RTLD_GLOBAL flag for dlopen-style dynamic loaders.
1 parent8396688 commitc87bc77

File tree

18 files changed

+44
-49
lines changed

18 files changed

+44
-49
lines changed

‎src/backend/port/dynloader/aix.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* $Id: aix.h,v 1.5 2001/03/22 03:59:42 momjian Exp $
2+
* $Id: aix.h,v 1.6 2001/05/14 21:45:53 petere Exp $
33
*
44
* @(#)dlfcn.h1.4 revision of 95/04/25 09:36:52
55
* This is an unpublished work copyright (c) 1992 HELIOS Software GmbH
@@ -58,7 +58,7 @@ extern"C"
5858

5959
#include"utils/dynamic_loader.h"
6060

61-
#definepg_dlopen(f)dlopen(f, RTLD_LAZY)
61+
#definepg_dlopen(f)dlopen((f), RTLD_LAZY | RTLD_GLOBAL)
6262
#definepg_dlsymdlsym
6363
#definepg_dlclose dlclose
6464
#definepg_dlerror dlerror

‎src/backend/port/dynloader/bsdi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*
1616
*-------------------------------------------------------------------------
1717
*/
18-
#ifdefPRE_BSDI_2_1
18+
#ifndefHAVE_DLOPEN
1919
#include"postgres.h"
2020

2121
externcharpg_pathname[];
@@ -95,4 +95,4 @@ pg_dlerror()
9595
returndld_strerror(dld_errno);
9696
}
9797

98-
#endif
98+
#endif/* not HAVE_DLOPEN */

‎src/backend/port/dynloader/bsdi.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/*-------------------------------------------------------------------------
22
*
3-
* port_protos.h
4-
* port-specific prototypes for SunOS 4
3+
* Dynamic loader interface for BSD/OS
54
*
65
*
76
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
@@ -16,19 +15,20 @@
1615

1716
#include"utils/dynamic_loader.h"
1817

19-
/* dynloader.c */
2018

21-
#ifndefPRE_BSDI_2_1
19+
#ifdefHAVE_DLOPEN
20+
2221
#include<dlfcn.h>
23-
#definepg_dlopen(f) dlopen(f, RTLD_LAZY)
22+
#definepg_dlopen(f) dlopen((f), RTLD_LAZY | RTLD_GLOBAL)
2423
#definepg_dlsym dlsym
2524
#definepg_dlclose dlclose
2625
#definepg_dlerror dlerror
27-
#else
26+
27+
#else/* not HAVE_DLOPEN */
28+
2829
#definepg_dlsym(handle,funcname) ((PGFunction) dld_get_func((funcname)))
2930
#definepg_dlclose(handle) ({ dld_unlink_by_file(handle, 1); free(handle); })
30-
#endif
3131

32-
/*port.c */
32+
#endif/*not HAVE_DLOPEN */
3333

3434
#endif/* PORT_PROTOS_H */

‎src/backend/port/dynloader/dgux.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
66
* Portions Copyright (c) 1994, Regents of the University of California
77
*
8-
* $Id: dgux.h,v 1.9 2001/02/10 02:31:26 tgl Exp $
8+
* $Id: dgux.h,v 1.10 2001/05/14 21:45:53 petere Exp $
99
*
1010
*-------------------------------------------------------------------------
1111
*/
@@ -23,7 +23,7 @@
2323
* library as the file to be dynamically loaded.
2424
*
2525
*/
26-
#definepg_dlopen(f) dlopen(f,1)
26+
#definepg_dlopen(f) dlopen((f), RTLD_LAZY | RTLD_GLOBAL)
2727
#definepg_dlsymdlsym
2828
#definepg_dlclosedlclose
2929
#definepg_dlerrordlerror

‎src/backend/port/dynloader/freebsd.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: freebsd.h,v 1.8 2001/02/10 02:31:26 tgl Exp $
10+
* $Id: freebsd.h,v 1.9 2001/05/14 21:45:53 petere Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -33,7 +33,7 @@
3333
* begin with an underscore is fairly tricky, and some versions of
3434
* NetBSD (like 1.0, and 1.0A pre June 1995) have no dlerror.)
3535
*/
36-
#definepg_dlopen(f) BSD44_derived_dlopen(f, 1)
36+
#definepg_dlopen(f) BSD44_derived_dlopen((f), RTLD_LAZY | RTLD_GLOBAL)
3737
#definepg_dlsym BSD44_derived_dlsym
3838
#definepg_dlclose BSD44_derived_dlclose
3939
#definepg_dlerror BSD44_derived_dlerror

‎src/backend/port/dynloader/irix5.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
* library as the file to be dynamically loaded.
2727
*
2828
*/
29-
#definepg_dlopen(f)dlopen(f,1)
29+
#definepg_dlopen(f)dlopen((f), RTLD_LAZY | RTLD_GLOBAL)
3030
#definepg_dlsymdlsym
3131
#definepg_dlclosedlclose
3232
#definepg_dlerrordlerror

‎src/backend/port/dynloader/linux.h

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,41 @@
11
/*-------------------------------------------------------------------------
22
*
3-
* port_protos.h
4-
* port-specific prototypes for Linux
3+
* Dynamic loader interface for Linux
54
*
65
*
76
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
87
* Portions Copyright (c) 1994, Regents of the University of California
98
*
10-
* $Id: linux.h,v 1.11 2001/02/10 02:31:26 tgl Exp $
9+
* $Id: linux.h,v 1.12 2001/05/14 21:45:53 petere Exp $
1110
*
1211
*-------------------------------------------------------------------------
1312
*/
1413
#ifndefPORT_PROTOS_H
1514
#definePORT_PROTOS_H
1615

1716
#include"utils/dynamic_loader.h"
18-
#ifdef__ELF__
17+
#ifdefHAVE_DLOPEN
1918
#include<dlfcn.h>
2019
#endif
2120

22-
/* dynloader.c */
2321

24-
#ifndef__ELF__
22+
#ifndefHAVE_DLOPEN
23+
2524
#ifndefHAVE_DLD_H
2625
#definepg_dlsym(handle,funcname)(NULL)
2726
#definepg_dlclose(handle) ({})
2827
#else
2928
#definepg_dlsym(handle,funcname)((PGFunction) dld_get_func((funcname)))
3029
#definepg_dlclose(handle) ({ dld_unlink_by_file(handle, 1); free(handle); })
3130
#endif
32-
#else
33-
/* #definepg_dlopen(f)dlopen(f, 1) */
34-
#definepg_dlopen(f)dlopen(f, 2)
31+
32+
#else/* HAVE_DLOPEN */
33+
34+
#definepg_dlopen(f)dlopen((f), RTLD_LAZY | RTLD_GLOBAL)
3535
#definepg_dlsymdlsym
3636
#definepg_dlclosedlclose
3737
#definepg_dlerrordlerror
38-
#endif
3938

40-
/*port.c */
39+
#endif/*HAVE_DLOPEN */
4140

4241
#endif/* PORT_PROTOS_H */

‎src/backend/port/dynloader/netbsd.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: netbsd.h,v 1.3 2001/02/10 02:31:26 tgl Exp $
10+
* $Id: netbsd.h,v 1.4 2001/05/14 21:45:53 petere Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -33,7 +33,7 @@
3333
* begin with an underscore is fairly tricky, and some versions of
3434
* NetBSD (like 1.0, and 1.0A pre June 1995) have no dlerror.)
3535
*/
36-
#definepg_dlopen(f) BSD44_derived_dlopen(f, 1)
36+
#definepg_dlopen(f) BSD44_derived_dlopen((f), RTLD_LAZY | RTLD_GLOBAL)
3737
#definepg_dlsym BSD44_derived_dlsym
3838
#definepg_dlclose BSD44_derived_dlclose
3939
#definepg_dlerror BSD44_derived_dlerror

‎src/backend/port/dynloader/openbsd.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: openbsd.h,v 1.3 2001/02/10 02:31:26 tgl Exp $
10+
* $Id: openbsd.h,v 1.4 2001/05/14 21:45:53 petere Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -33,7 +33,7 @@
3333
* begin with an underscore is fairly tricky, and some versions of
3434
* NetBSD (like 1.0, and 1.0A pre June 1995) have no dlerror.)
3535
*/
36-
#definepg_dlopen(f) BSD44_derived_dlopen(f, 1)
36+
#definepg_dlopen(f) BSD44_derived_dlopen((f), RTLD_LAZY | RTLD_GLOBAL)
3737
#definepg_dlsym BSD44_derived_dlsym
3838
#definepg_dlclose BSD44_derived_dlclose
3939
#definepg_dlerror BSD44_derived_dlerror

‎src/backend/port/dynloader/osf.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: osf.h,v 1.2 2001/01/24 19:43:04 momjian Exp $
10+
* $Id: osf.h,v 1.3 2001/05/14 21:45:53 petere Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -28,7 +28,7 @@
2828
* library as the file to be dynamically loaded.
2929
*
3030
*/
31-
#definepg_dlopen(f)dlopen(f, RTLD_LAZY)
31+
#definepg_dlopen(f)dlopen((f), RTLD_LAZY | RTLD_GLOBAL)
3232
#definepg_dlsym(h,f) ((PGFunction) dlsym(h, f))
3333
#definepg_dlclose(h)dlclose(h)
3434
#definepg_dlerror()dlerror()

‎src/backend/port/dynloader/sco.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: sco.h,v 1.7 2001/02/10 02:31:26 tgl Exp $
10+
* $Id: sco.h,v 1.8 2001/05/14 21:45:53 petere Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -26,7 +26,7 @@
2626
* library as the file to be dynamically loaded.
2727
*
2828
*/
29-
#definepg_dlopen(f)dlopen(f,1)
29+
#definepg_dlopen(f)dlopen((f), RTLD_LAZY | RTLD_GLOBAL)
3030
#definepg_dlsymdlsym
3131
#definepg_dlclosedlclose
3232
#definepg_dlerrordlerror

‎src/backend/port/dynloader/solaris.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
/* $Header: /cvsroot/pgsql/src/backend/port/dynloader/solaris.h,v 1.3 2001/03/22 03:59:43 momjian Exp $ */
1+
/* $Header: /cvsroot/pgsql/src/backend/port/dynloader/solaris.h,v 1.4 2001/05/14 21:45:53 petere Exp $ */
22

33
#ifndefDYNLOADER_SOLARIS_H
44
#defineDYNLOADER_SOLARIS_H
55

66
#include<dlfcn.h>
77
#include"utils/dynamic_loader.h"
88

9-
#definepg_dlopen(f)dlopen(f,1)
9+
#definepg_dlopen(f)dlopen((f), RTLD_LAZY | RTLD_GLOBAL)
1010
#definepg_dlsymdlsym
1111
#definepg_dlclosedlclose
1212
#definepg_dlerrordlerror

‎src/backend/port/dynloader/sunos4.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: sunos4.h,v 1.7 2001/02/10 02:31:26 tgl Exp $
10+
* $Id: sunos4.h,v 1.8 2001/05/14 21:45:53 petere Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -26,7 +26,7 @@
2626
* library as the file to be dynamically loaded.
2727
*
2828
*/
29-
#definepg_dlopen(f)dlopen(f, 1)
29+
#definepg_dlopen(f)dlopen((f), RTLD_LAZY | RTLD_GLOBAL)
3030
#definepg_dlsymdlsym
3131
#definepg_dlclosedlclose
3232
#definepg_dlerrordlerror

‎src/backend/port/dynloader/svr4.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: svr4.h,v 1.7 2001/02/10 02:31:26 tgl Exp $
10+
* $Id: svr4.h,v 1.8 2001/05/14 21:45:53 petere Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -26,7 +26,7 @@
2626
* library as the file to be dynamically loaded.
2727
*
2828
*/
29-
#definepg_dlopen(f)dlopen(f,RTLD_LAZY)
29+
#definepg_dlopen(f)dlopen((f),RTLD_LAZY | RTLD_GLOBAL)
3030
#definepg_dlsymdlsym
3131
#definepg_dlclosedlclose
3232
#definepg_dlerrordlerror

‎src/backend/port/dynloader/univel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
* library as the file to be dynamically loaded.
2727
*
2828
*/
29-
#definepg_dlopen(f)dlopen(f,RTLD_LAZY)
29+
#definepg_dlopen(f)dlopen((f),RTLD_LAZY | RTLD_GLOBAL)
3030
#definepg_dlsymdlsym
3131
#definepg_dlclosedlclose
3232
#definepg_dlerrordlerror

‎src/backend/port/dynloader/unixware.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
* library as the file to be dynamically loaded.
2727
*
2828
*/
29-
#definepg_dlopen(f)dlopen(f,RTLD_LAZY)
29+
#definepg_dlopen(f)dlopen((f),RTLD_LAZY | RTLD_GLOBAL)
3030
#definepg_dlsymdlsym
3131
#definepg_dlclosedlclose
3232
#definepg_dlerrordlerror

‎src/backend/port/dynloader/win.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
* library as the file to be dynamically loaded.
2727
*
2828
*/
29-
#definepg_dlopen(f)dlopen(f,1)
29+
#definepg_dlopen(f)dlopen((f), RTLD_LAZY | RTLD_GLOBAL)
3030
#definepg_dlsymdlsym
3131
#definepg_dlclosedlclose
3232
#definepg_dlerrordlerror

‎src/template/bsdi

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ case $host_cpu in
44
i?86) CFLAGS="$CFLAGS -m486";;
55
esac
66

7-
case $host_os in
8-
bsdi2.0) CFLAGS="$CFLAGS -DPRE_BSDI_2_1";;
9-
esac
10-
117
case $host_os in
128
bsdi2.0 | bsdi2.1 | bsdi3*)
139
CC=gcc2

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp