Re: Reduce function call costs on ELF platforms

From: Andres Freund <andres(at)anarazel(dot)de>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Reduce function call costs on ELF platforms
Date: 2021-11-23 01:18:01
Message-ID: 20211123011801.owaqwcy5vcoc6slg@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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 the ability to intercept symbols referenced in a previously
> > loaded shared library, with a subsequently loaded library (e.g. loaded with
> > RTLD_DEEPBIND) function before the symbol is used. But that seems like a
> > stretch. And I think most ELF platforms/linux distributions have/are moving
> > towards using -Wl,-z,now -Wl,-z,relro also makes symbols bound eagerly.
>
> I found this really interesting, and I am surprised how things got so
> suboptimal.

It's always been this way on ELF afaict (*).

I don't think anybody would design ELF the same way today. I think it's pretty
clear that defaulting to making symbols interceptable was a bad idea. But it's
where we are...

> Has it always been this way? Is it the use of C++ that is causing this by
> default?

Nope, this is with plain C.

Greetings,

Andres Freund

(*) I guess you can argue it got a tad worse with the increasing use of
position independent executables, but that's a relatively small difference in
the scope of the issue.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andy Fan 2021-11-23 01:27:11 Re: Sequence's value can be rollback after a crashed recovery.
Previous Message Bruce Momjian 2021-11-23 01:13:28 Re: Reduce function call costs on ELF platforms