Re: Reduce function call costs on ELF platforms - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Reduce function call costs on ELF platforms
Date
Msg-id 20211123011801.owaqwcy5vcoc6slg@alap3.anarazel.de
Whole thread Raw
In response to Re: Reduce function call costs on ELF platforms  (Bruce Momjian <bruce@momjian.us>)
List 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.



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Reduce function call costs on ELF platforms
Next
From: Andy Fan
Date:
Subject: Re: Sequence's value can be rollback after a crashed recovery.