Re: Reduce function call costs on ELF platforms

2021-11-25 Thread Andrew Dunstan
On 11/24/21 22:57, Andres Freund wrote: > >> Which things does it break exactly? > -Bsymbolic causes symbols that are defined and referenced within one shared > library to use that definition. E.g. if a shared lib has a function > "do_something()" and some of its code calls do_something(), you ca

Re: Reduce function call costs on ELF platforms

2021-11-24 Thread Andres Freund
Hi, On 2021-11-24 17:55:03 -0500, Andrew Dunstan wrote: > On 11/24/21 13:55, Andres Freund wrote: > > On 2021-11-23 17:28:08 +0100, Peter Eisentraut wrote: > >> On 22.11.21 23:32, Tom Lane wrote: > The easier approach for this class of issues is to use the linker option > -Bsymbolic. > >

Re: Reduce function call costs on ELF platforms

2021-11-24 Thread Andrew Dunstan
On 11/24/21 13:55, Andres Freund wrote: > Hi, > > On 2021-11-23 17:28:08 +0100, Peter Eisentraut wrote: >> On 22.11.21 23:32, Tom Lane wrote: The easier approach for this class of issues is to use the linker option -Bsymbolic. >>> I don't recall details, but we've previously rejected th

Re: Reduce function call costs on ELF platforms

2021-11-24 Thread Andres Freund
Hi, On 2021-11-23 17:28:08 +0100, Peter Eisentraut wrote: > On 22.11.21 23:32, Tom Lane wrote: > > > The easier approach for this class of issues is to use the linker option > > > -Bsymbolic. > > I don't recall details, but we've previously rejected the idea of > > trying to use -Bsymbolic widely;

Re: Reduce function call costs on ELF platforms

2021-11-23 Thread Peter Eisentraut
On 22.11.21 23:32, Tom Lane wrote: The easier approach for this class of issues is to use the linker option -Bsymbolic. I don't recall details, but we've previously rejected the idea of trying to use -Bsymbolic widely; apparently it has undesirable side-effects on some platforms. See commit mes

Re: Reduce function call costs on ELF platforms

2021-11-22 Thread Andres Freund
Hi, On 2021-11-22 20:13:28 -0500, Bruce Momjian wrote: > On Mon, Nov 22, 2021 at 03:57:45PM -0800, Andres Freund wrote: > > It does however change symbol binding, basically making all symbols bound > > eagerly. Which I guess theoretically could be considered an ABI change, > > because it removes t

Re: Reduce function call costs on ELF platforms

2021-11-22 Thread Bruce Momjian
On Mon, Nov 22, 2021 at 03:57:45PM -0800, Andres Freund wrote: > It does however change symbol binding, basically making all symbols bound > eagerly. Which I guess theoretically could be considered an ABI change, > because it removes the ability to intercept symbols referenced in a previously > loa

Re: Reduce function call costs on ELF platforms

2021-11-22 Thread Andres Freund
Hi, On 2021-11-22 17:32:21 -0500, Tom Lane wrote: > > The easier approach for this class of issues is to use the linker option > > -Bsymbolic. > > I don't recall details, but we've previously rejected the idea of > trying to use -Bsymbolic widely; apparently it has undesirable > side-effects on s

Re: Reduce function call costs on ELF platforms

2021-11-22 Thread Tom Lane
Andres Freund writes: > Basically they way we currently build our extensions, the compiler & linker > assume every symbol inside the extension libraries needs to be interceptable > by the main binary. Which means that all function calls to symbols visible > outside the current translation unit nee

Reduce function call costs on ELF platforms

2021-11-22 Thread Andres Freund
Hi, There's two related, but somewhat different aspects to $subject. TL;DR: We use use -fvisibility=hidden + explicit symbol visiblity, -Wl,-Bdynamic, -fno-plt 1) Cross-translation-unit calls in extension library A while ago I was looking at a profile of a workload that spent a good chunk of t