Re: RTLD_GLOBAL (& JIT inlining)

2019-01-24 Thread Kyotaro HORIGUCHI
At Thu, 24 Jan 2019 01:02:14 -0500, Tom Lane wrote in <24744.1548309...@sss.pgh.pa.us> > Kyotaro HORIGUCHI writes: > > With the attached patch, external modules are loaded RTLD_LOCAL > > by default. PG_MODULE_EXPORT_SYMBOL in a module source files let > > it loaded RTLD_GLOBAL. I suppose this

Re: RTLD_GLOBAL (& JIT inlining)

2019-01-23 Thread Tom Lane
Kyotaro HORIGUCHI writes: > With the attached patch, external modules are loaded RTLD_LOCAL > by default. PG_MODULE_EXPORT_SYMBOL in a module source files let > it loaded RTLD_GLOBAL. I suppose this is the change with the > least impact on existing modules because I believe most of them > don't

Re: RTLD_GLOBAL (& JIT inlining)

2019-01-23 Thread Kyotaro HORIGUCHI
Hello. At Mon, 26 Feb 2018 23:50:41 +0200, Ants Aasma wrote in > On Mon, Feb 26, 2018 at 11:28 PM, Andres Freund wrote: > > So RTLD_LOCAL is out of the question, but I think we can get a good bit > > of the benefit by either specifying -Wl,-Bsymbolic at shlib build time, > > or RTLD_DEEPBIND

Re: RTLD_GLOBAL (& JIT inlining)

2018-02-26 Thread Ants Aasma
On Mon, Feb 26, 2018 at 11:28 PM, Andres Freund wrote: > So RTLD_LOCAL is out of the question, but I think we can get a good bit > of the benefit by either specifying -Wl,-Bsymbolic at shlib build time, > or RTLD_DEEPBIND at dlopen() time. Either leads to the opened shared >

Re: RTLD_GLOBAL (& JIT inlining)

2018-02-26 Thread Andres Freund
On 2018-02-23 11:05:23 -0500, Tom Lane wrote: > Andres Freund writes: > > I think using RTLD_LOCAL on most machines would be a much better > > idea. I've not found proper explanations why GLOBAL is used. We started > > using it ages ago, with [2], but that commit contains no

Re: RTLD_GLOBAL (& JIT inlining)

2018-02-23 Thread Andres Freund
Hi, On 2018-02-22 23:11:07 -0800, Andres Freund wrote: > I think using RTLD_LOCAL on most machines would be a much better > idea. I've not found proper explanations why GLOBAL is used. We started > using it ages ago, with [2], but that commit contains no explanation, > and a quick search didn't

RTLD_GLOBAL (& JIT inlining)

2018-02-22 Thread Andres Freund
Hi Peter, All, First question: Why do we currently use RTLD_GLOBAL loading extension libraries, but take pains ([1]) to make things work without RTLD_GLOBAL. It seems like it'd be both safer to RTLD_LOCAL on platforms supporting it (or equivalent), as well as less error-prone because we'd be