diff mbox series

Fix glibc 2.34 ABI omission (missing GLIBC_2.34 in dynamic loader)

Message ID 87h7bjmnt0.fsf@oldenburg.str.redhat.com
State New
Headers show
Series Fix glibc 2.34 ABI omission (missing GLIBC_2.34 in dynamic loader) | expand

Checks

Context Check Description
dj/TryBot-apply_patch success Patch applied to master at the time it was sent
dj/TryBot-32bit success Build for i686

Commit Message

Florian Weimer Dec. 8, 2021, 9:46 a.m. UTC
The glibc 2.34 release really should have added a GLIBC_2.34
symbol to the dynamic loader. With it, we could move functions such
as dlopen or pthread_key_create that work on process-global state
into the dynamic loader (once we have fixed a longstanding issue
with static linking).  Without the GLIBC_2.34 symbol, yet another
new symbol version would be needed because old glibc will fail to
load binaries due to the missing symbol version in ld.so that newly
linked programs will require.

This needs to be backported to the glibc 2.34 release branch as well,
where hopefully all distributions will pick it up eventually.

Tested on i686-linux-gnu, x86_64-linux-gnu.  Built with
build-many-glibcs.py.

---
 elf/Makefile                                       |  2 +-
 elf/Versions                                       |  3 +++
 elf/dl-compat.c                                    | 30 ++++++++++++++++++++++
 sysdeps/mach/hurd/i386/ld.abilist                  |  1 +
 sysdeps/unix/sysv/linux/aarch64/ld.abilist         |  1 +
 sysdeps/unix/sysv/linux/alpha/ld.abilist           |  1 +
 sysdeps/unix/sysv/linux/arc/ld.abilist             |  1 +
 sysdeps/unix/sysv/linux/arm/be/ld.abilist          |  1 +
 sysdeps/unix/sysv/linux/arm/le/ld.abilist          |  1 +
 sysdeps/unix/sysv/linux/csky/ld.abilist            |  1 +
 sysdeps/unix/sysv/linux/hppa/ld.abilist            |  1 +
 sysdeps/unix/sysv/linux/i386/ld.abilist            |  1 +
 sysdeps/unix/sysv/linux/ia64/ld.abilist            |  1 +
 sysdeps/unix/sysv/linux/m68k/coldfire/ld.abilist   |  1 +
 sysdeps/unix/sysv/linux/m68k/m680x0/ld.abilist     |  1 +
 sysdeps/unix/sysv/linux/microblaze/ld.abilist      |  1 +
 sysdeps/unix/sysv/linux/mips/mips32/ld.abilist     |  1 +
 sysdeps/unix/sysv/linux/mips/mips64/n32/ld.abilist |  1 +
 sysdeps/unix/sysv/linux/mips/mips64/n64/ld.abilist |  1 +
 sysdeps/unix/sysv/linux/nios2/ld.abilist           |  1 +
 .../unix/sysv/linux/powerpc/powerpc32/ld.abilist   |  1 +
 .../sysv/linux/powerpc/powerpc64/be/ld.abilist     |  1 +
 .../sysv/linux/powerpc/powerpc64/le/ld.abilist     |  1 +
 sysdeps/unix/sysv/linux/riscv/rv32/ld.abilist      |  1 +
 sysdeps/unix/sysv/linux/riscv/rv64/ld.abilist      |  1 +
 sysdeps/unix/sysv/linux/s390/s390-32/ld.abilist    |  1 +
 sysdeps/unix/sysv/linux/s390/s390-64/ld.abilist    |  1 +
 sysdeps/unix/sysv/linux/sh/be/ld.abilist           |  1 +
 sysdeps/unix/sysv/linux/sh/le/ld.abilist           |  1 +
 sysdeps/unix/sysv/linux/sparc/sparc32/ld.abilist   |  1 +
 sysdeps/unix/sysv/linux/sparc/sparc64/ld.abilist   |  1 +
 sysdeps/unix/sysv/linux/x86_64/64/ld.abilist       |  1 +
 sysdeps/unix/sysv/linux/x86_64/x32/ld.abilist      |  1 +
 33 files changed, 64 insertions(+), 1 deletion(-)

Comments

Andreas Schwab Dec. 8, 2021, 9:56 a.m. UTC | #1
On Dez 08 2021, Florian Weimer via Libc-alpha wrote:

> The glibc 2.34 release really should have added a GLIBC_2.34
> symbol to the dynamic loader.

Well, the ship has sailed.

> With it, we could move functions such as dlopen or pthread_key_create
> that work on process-global state into the dynamic loader (once we
> have fixed a longstanding issue with static linking).

Why does this depend on the frozen release?

Andreas.
Florian Weimer Dec. 8, 2021, 10:06 a.m. UTC | #2
* Andreas Schwab:

> On Dez 08 2021, Florian Weimer via Libc-alpha wrote:
>
>> The glibc 2.34 release really should have added a GLIBC_2.34
>> symbol to the dynamic loader.
>
> Well, the ship has sailed.

Has it?  It's just software, we can change it.

It's different from other ABI changes in that we wouldn't be using the
symbol version node immediately, and the actual symbol (if we start to
use it) would already be there in libc.so.6.

>> With it, we could move functions such as dlopen or pthread_key_create
>> that work on process-global state into the dynamic loader (once we
>> have fixed a longstanding issue with static linking).
>
> Why does this depend on the frozen release?

Say we move dlopen into ld.so in glibc 2.36.  It will no longer be
present in libc.so.6.  Applications linked against glibc 2.36 will
continue referencing dlopen@GLIBC_2.34, but with a soname baked into the
version reference that mentions the dynamic loader (say, ld64.so.1).  On
the current glibc 2.34 release, the dynamic loader sees that soname,
checks if the object has a version node for GLIBC_2.34, and refuses
loading the application because ld64.so.1 does not have this version
node.

Thanks,
Florian
Andreas Schwab Dec. 8, 2021, 10:20 a.m. UTC | #3
On Dez 08 2021, Florian Weimer wrote:

> * Andreas Schwab:
>
>> On Dez 08 2021, Florian Weimer via Libc-alpha wrote:
>>
>>> The glibc 2.34 release really should have added a GLIBC_2.34
>>> symbol to the dynamic loader.
>>
>> Well, the ship has sailed.
>
> Has it?  It's just software, we can change it.

ABI is not software, it's a contract.

Andreas.
Florian Weimer Dec. 8, 2021, 10:28 a.m. UTC | #4
* Andreas Schwab:

> On Dez 08 2021, Florian Weimer wrote:
>
>> * Andreas Schwab:
>>
>>> On Dez 08 2021, Florian Weimer via Libc-alpha wrote:
>>>
>>>> The glibc 2.34 release really should have added a GLIBC_2.34
>>>> symbol to the dynamic loader.
>>>
>>> Well, the ship has sailed.
>>
>> Has it?  It's just software, we can change it.
>
> ABI is not software, it's a contract.

But sometimes we have to to fix bugs.  Again, what I propose is quite
different from a simple symbol change because distributions and users
can fix this now, well before the symbol is going to be used.

I have considered using a stub DSO and mention that instead of libc.so.6
in the libc.so linker script.  But I'm not sure how we can prevent users
from linking against the moved symbol by bypassing the linker script.
That would produce ABI-incompatible binaries.  We could turn it into a
compat symbol, but as long as it's in the dynamic symbol table, some
people will use it.

Thanks,
Florian
H.J. Lu Dec. 8, 2021, 2:06 p.m. UTC | #5
On Wed, Dec 8, 2021 at 2:29 AM Florian Weimer via Libc-alpha
<libc-alpha@sourceware.org> wrote:
>
> * Andreas Schwab:
>
> > On Dez 08 2021, Florian Weimer wrote:
> >
> >> * Andreas Schwab:
> >>
> >>> On Dez 08 2021, Florian Weimer via Libc-alpha wrote:
> >>>
> >>>> The glibc 2.34 release really should have added a GLIBC_2.34
> >>>> symbol to the dynamic loader.
> >>>
> >>> Well, the ship has sailed.
> >>
> >> Has it?  It's just software, we can change it.
> >
> > ABI is not software, it's a contract.
>
> But sometimes we have to to fix bugs.  Again, what I propose is quite
> different from a simple symbol change because distributions and users
> can fix this now, well before the symbol is going to be used.

I think we should do it and ask distributions to backport the patch.

> I have considered using a stub DSO and mention that instead of libc.so.6
> in the libc.so linker script.  But I'm not sure how we can prevent users
> from linking against the moved symbol by bypassing the linker script.
> That would produce ABI-incompatible binaries.  We could turn it into a
> compat symbol, but as long as it's in the dynamic symbol table, some
> people will use it.
>
> Thanks,
> Florian
>
Siddhesh Poyarekar Dec. 8, 2021, 4:59 p.m. UTC | #6
On 12/8/21 15:16, Florian Weimer via Libc-alpha wrote:
> The glibc 2.34 release really should have added a GLIBC_2.34
> symbol to the dynamic loader. With it, we could move functions such
> as dlopen or pthread_key_create that work on process-global state
> into the dynamic loader (once we have fixed a longstanding issue
> with static linking).  Without the GLIBC_2.34 symbol, yet another
> new symbol version would be needed because old glibc will fail to
> load binaries due to the missing symbol version in ld.so that newly
> linked programs will require.
> 
> This needs to be backported to the glibc 2.34 release branch as well,
> where hopefully all distributions will pick it up eventually.

ISTM we could move symbols between ld.so and libc.so at will, without 
bumping symbol versions because they'll always be used together.  In 
that sense, maybe we should not really consider such moves as ABI events 
at all?

Siddhesh
Florian Weimer Dec. 13, 2021, 12:15 p.m. UTC | #7
* Siddhesh Poyarekar:

> On 12/8/21 15:16, Florian Weimer via Libc-alpha wrote:
>> The glibc 2.34 release really should have added a GLIBC_2.34
>> symbol to the dynamic loader. With it, we could move functions such
>> as dlopen or pthread_key_create that work on process-global state
>> into the dynamic loader (once we have fixed a longstanding issue
>> with static linking).  Without the GLIBC_2.34 symbol, yet another
>> new symbol version would be needed because old glibc will fail to
>> load binaries due to the missing symbol version in ld.so that newly
>> linked programs will require.
>> This needs to be backported to the glibc 2.34 release branch as
>> well,
>> where hopefully all distributions will pick it up eventually.
>
> ISTM we could move symbols between ld.so and libc.so at will, without
> bumping symbol versions because they'll always be used together.  In 
> that sense, maybe we should not really consider such moves as ABI
> events at all?

It's only possible to move symbols if version nodes exist on both
sides.  Therefore, this patch adds a version node to ld.so.

Without the version node, a binary linked against newer glibc will start
referencing GLIBC_2.34 in ld.so after a symbol move to ld.so.  The lazy
bindign consistency check for symbol version nodes in unpatch old glibc
2.34 will then reject to load such binaries, even though a symbol
definition would be found during binding (as you point out).

Thanks,
Florian
Siddhesh Poyarekar Dec. 13, 2021, 2:54 p.m. UTC | #8
On 12/13/21 17:45, Florian Weimer wrote:
> It's only possible to move symbols if version nodes exist on both
> sides.  Therefore, this patch adds a version node to ld.so.

Could we enforce via a test that both libc.so and ld.so always have the 
same version nodes?  That'll give us future flexibility at the cost of 
the extra few bytes.

> Without the version node, a binary linked against newer glibc will start
> referencing GLIBC_2.34 in ld.so after a symbol move to ld.so.  The lazy

Would it contain a reference to ld.so though?  IIRC, the symbol/version 
checks don't care about the DSO in which they are found.  So in old 
glibc, it should resolve to pthread_key_create@GLIBC_2.34 in libc.so.6 
and in newer glibc it should resolve to pthread_key_create@GLIBC_2.34 in 
ld.so.

Siddhesh
Florian Weimer Dec. 24, 2021, 7:01 p.m. UTC | #9
* Florian Weimer via Libc-alpha:

> * Andreas Schwab:
>
>> On Dez 08 2021, Florian Weimer wrote:
>>
>>> * Andreas Schwab:
>>>
>>>> On Dez 08 2021, Florian Weimer via Libc-alpha wrote:
>>>>
>>>>> The glibc 2.34 release really should have added a GLIBC_2.34
>>>>> symbol to the dynamic loader.
>>>>
>>>> Well, the ship has sailed.
>>>
>>> Has it?  It's just software, we can change it.
>>
>> ABI is not software, it's a contract.
>
> But sometimes we have to to fix bugs.  Again, what I propose is quite
> different from a simple symbol change because distributions and users
> can fix this now, well before the symbol is going to be used.
>
> I have considered using a stub DSO and mention that instead of libc.so.6
> in the libc.so linker script.  But I'm not sure how we can prevent users
> from linking against the moved symbol by bypassing the linker script.
> That would produce ABI-incompatible binaries.  We could turn it into a
> compat symbol, but as long as it's in the dynamic symbol table, some
> people will use it.

Let me propose a look at this from a different angle.

Let's say we do not apply this change.  Then if we move dlopen (say)
into ld.so, it needs to have a new symbol version, say dlopen@GLIBC_2.36
(to enable early errors on old glibc even with lazy binding).  The net
result will be that dlopen-using binaries linked against glibc 2.36 or
later will not work with glibc 2.34.

Binaries linked against glibc 2.34 with or without the proposed change
are fully interoperable (forwards and backwards compatible).  No new
symbol version/soname combination is ever generated by the link editor
because the GLIBC_2.34 version in ld.so is effectively empty.
Considering the moved dlopen, we would give it version of
dlopen@GLIBC_2.34 (even if the symbol is added in glibc 2.36).  Binaries
linked against glibc 2.36 will still fail when running at the initial
version of glibc 2.34.  But with the proposed patch here, they will work
even with glibc 2.34.  This means that there are no ABI
incompatibilities introduce by this patch, and we enable compatibility
with future symbol moves.

Andreas, what do you think?

Thanks,
Florian
Carlos O'Donell Jan. 13, 2022, 5:22 p.m. UTC | #10
On 12/24/21 14:01, Florian Weimer via Libc-alpha wrote:
> * Florian Weimer via Libc-alpha:
> 
>> * Andreas Schwab:
>>
>>> On Dez 08 2021, Florian Weimer wrote:
>>>
>>>> * Andreas Schwab:
>>>>
>>>>> On Dez 08 2021, Florian Weimer via Libc-alpha wrote:
>>>>>
>>>>>> The glibc 2.34 release really should have added a GLIBC_2.34
>>>>>> symbol to the dynamic loader.
>>>>>
>>>>> Well, the ship has sailed.
>>>>
>>>> Has it?  It's just software, we can change it.
>>>
>>> ABI is not software, it's a contract.
>>
>> But sometimes we have to to fix bugs.  Again, what I propose is quite
>> different from a simple symbol change because distributions and users
>> can fix this now, well before the symbol is going to be used.
>>
>> I have considered using a stub DSO and mention that instead of libc.so.6
>> in the libc.so linker script.  But I'm not sure how we can prevent users
>> from linking against the moved symbol by bypassing the linker script.
>> That would produce ABI-incompatible binaries.  We could turn it into a
>> compat symbol, but as long as it's in the dynamic symbol table, some
>> people will use it.
> 
> Let me propose a look at this from a different angle.
> 
> Let's say we do not apply this change.  Then if we move dlopen (say)
> into ld.so, it needs to have a new symbol version, say dlopen@GLIBC_2.36
> (to enable early errors on old glibc even with lazy binding).  The net
> result will be that dlopen-using binaries linked against glibc 2.36 or
> later will not work with glibc 2.34.
> 
> Binaries linked against glibc 2.34 with or without the proposed change
> are fully interoperable (forwards and backwards compatible).  No new
> symbol version/soname combination is ever generated by the link editor
> because the GLIBC_2.34 version in ld.so is effectively empty.
> Considering the moved dlopen, we would give it version of
> dlopen@GLIBC_2.34 (even if the symbol is added in glibc 2.36).  Binaries
> linked against glibc 2.36 will still fail when running at the initial
> version of glibc 2.34.  But with the proposed patch here, they will work
> even with glibc 2.34.  This means that there are no ABI
> incompatibilities introduce by this patch, and we enable compatibility
> with future symbol moves.

Agreed.

The point is to have the same GLIBC_2.34 in ld.so and libc.so.6 to facilitate moving
symbols in the future without needing to use a new version node. This makes complete
sense.
Florian Weimer Jan. 13, 2022, 5:32 p.m. UTC | #11
* Florian Weimer via Libc-alpha:

> * Florian Weimer via Libc-alpha:
>
>> * Andreas Schwab:
>>
>>> On Dez 08 2021, Florian Weimer wrote:
>>>
>>>> * Andreas Schwab:
>>>>
>>>>> On Dez 08 2021, Florian Weimer via Libc-alpha wrote:
>>>>>
>>>>>> The glibc 2.34 release really should have added a GLIBC_2.34
>>>>>> symbol to the dynamic loader.
>>>>>
>>>>> Well, the ship has sailed.
>>>>
>>>> Has it?  It's just software, we can change it.
>>>
>>> ABI is not software, it's a contract.
>>
>> But sometimes we have to to fix bugs.  Again, what I propose is quite
>> different from a simple symbol change because distributions and users
>> can fix this now, well before the symbol is going to be used.
>>
>> I have considered using a stub DSO and mention that instead of libc.so.6
>> in the libc.so linker script.  But I'm not sure how we can prevent users
>> from linking against the moved symbol by bypassing the linker script.
>> That would produce ABI-incompatible binaries.  We could turn it into a
>> compat symbol, but as long as it's in the dynamic symbol table, some
>> people will use it.
>
> Let me propose a look at this from a different angle.
>
> Let's say we do not apply this change.  Then if we move dlopen (say)
> into ld.so, it needs to have a new symbol version, say dlopen@GLIBC_2.36
> (to enable early errors on old glibc even with lazy binding).  The net
> result will be that dlopen-using binaries linked against glibc 2.36 or
> later will not work with glibc 2.34.
>
> Binaries linked against glibc 2.34 with or without the proposed change
> are fully interoperable (forwards and backwards compatible).  No new
> symbol version/soname combination is ever generated by the link editor
> because the GLIBC_2.34 version in ld.so is effectively empty.
> Considering the moved dlopen, we would give it version of
> dlopen@GLIBC_2.34 (even if the symbol is added in glibc 2.36).  Binaries
> linked against glibc 2.36 will still fail when running at the initial
> version of glibc 2.34.  But with the proposed patch here, they will work
> even with glibc 2.34.  This means that there are no ABI
> incompatibilities introduce by this patch, and we enable compatibility
> with future symbol moves.

Andreas, do you find this line of reasoning convincing?

Thanks,
Florian
Carlos O'Donell Jan. 13, 2022, 5:56 p.m. UTC | #12
On 12/13/21 09:54, Siddhesh Poyarekar wrote:
> On 12/13/21 17:45, Florian Weimer wrote:
>> It's only possible to move symbols if version nodes exist on both 
>> sides.  Therefore, this patch adds a version node to ld.so.
> 
> Could we enforce via a test that both libc.so and ld.so always have
> the same version nodes?  That'll give us future flexibility at the
> cost of the extra few bytes.

I agree this might be a nice addition to allow symbols to move between the objects.

I wouldn't block this patch on such a belt-and-suspenders check, but I agree that
checking if they have the same version notes would be useful. We haven't ever done
this in the past.
 
>> Without the version node, a binary linked against newer glibc will
>> start referencing GLIBC_2.34 in ld.so after a symbol move to ld.so.
>> The lazy
> 
> Would it contain a reference to ld.so though?  IIRC, the
> symbol/version checks don't care about the DSO in which they are
> found.  So in old glibc, it should resolve to
> pthread_key_create@GLIBC_2.34 in libc.so.6 and in newer glibc it
> should resolve to pthread_key_create@GLIBC_2.34 in ld.so.

They do care.

Unfixed:
LD_LIBRARY_PATH=. ./main-v2
./main-v2: ./lib2.so: version `FIRST_1.0' not found (required by ./main-v2)
./main-v2: ./lib1.so: version `FIRST_1.1' not found (required by ./main-v2)
- Loader looks to determine if version node is present in the referenced DSO.

e.g.
Version needs section '.gnu.version_r' contains 3 entries:
 Addr: 0x00000000004004f8  Offset: 0x0004f8  Link: 7 (.dynstr)
  000000: Version: 1  File: lib2.so  Cnt: 1
  0x0010:   Name: FIRST_1.0  Flags: none  Version: 5
  0x0020: Version: 1  File: lib1.so  Cnt: 1
  0x0030:   Name: FIRST_1.1  Flags: none  Version: 4
  0x0040: Version: 1  File: libc.so.6  Cnt: 2
  0x0050:   Name: GLIBC_2.2.5  Flags: none  Version: 3
  0x0060:   Name: GLIBC_2.34  Flags: none  Version: 2

Fixed:
LD_LIBRARY_PATH=. ./main-v2
first = 0, second = 42
- Loader finds both version nodes in the bound library.

While the symbol@version can move, if the version node is missing you still
get a diagnostic, and that forces you to add a completely new version, when
all you did was move the existing version.

There are two kinds of checks:

- Does my DSO contain the version nodes I expected?
- Does a DSO contain the symbol@version I expected?

We never relaxed the version node check because it's a useful first pass
check. We've always been moving symbols for which the target DSO had the
same version node.
Carlos O'Donell Jan. 13, 2022, 6 p.m. UTC | #13
On 12/8/21 04:46, Florian Weimer via Libc-alpha wrote:
> The glibc 2.34 release really should have added a GLIBC_2.34
> symbol to the dynamic loader. With it, we could move functions such
> as dlopen or pthread_key_create that work on process-global state
> into the dynamic loader (once we have fixed a longstanding issue
> with static linking).  Without the GLIBC_2.34 symbol, yet another
> new symbol version would be needed because old glibc will fail to
> load binaries due to the missing symbol version in ld.so that newly
> linked programs will require.
> 
> This needs to be backported to the glibc 2.34 release branch as well,
> where hopefully all distributions will pick it up eventually.
> 
> Tested on i686-linux-gnu, x86_64-linux-gnu.  Built with
> build-many-glibcs.py.

CI/CD passed on i686. Needs rebasing after aee6e90f93e285016b6cd9c8bd00402c19ba271b.

LGTM.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
 
> ---
>  elf/Makefile                                       |  2 +-
>  elf/Versions                                       |  3 +++
>  elf/dl-compat.c                                    | 30 ++++++++++++++++++++++
>  sysdeps/mach/hurd/i386/ld.abilist                  |  1 +
>  sysdeps/unix/sysv/linux/aarch64/ld.abilist         |  1 +
>  sysdeps/unix/sysv/linux/alpha/ld.abilist           |  1 +
>  sysdeps/unix/sysv/linux/arc/ld.abilist             |  1 +
>  sysdeps/unix/sysv/linux/arm/be/ld.abilist          |  1 +
>  sysdeps/unix/sysv/linux/arm/le/ld.abilist          |  1 +
>  sysdeps/unix/sysv/linux/csky/ld.abilist            |  1 +
>  sysdeps/unix/sysv/linux/hppa/ld.abilist            |  1 +
>  sysdeps/unix/sysv/linux/i386/ld.abilist            |  1 +
>  sysdeps/unix/sysv/linux/ia64/ld.abilist            |  1 +
>  sysdeps/unix/sysv/linux/m68k/coldfire/ld.abilist   |  1 +
>  sysdeps/unix/sysv/linux/m68k/m680x0/ld.abilist     |  1 +
>  sysdeps/unix/sysv/linux/microblaze/ld.abilist      |  1 +
>  sysdeps/unix/sysv/linux/mips/mips32/ld.abilist     |  1 +
>  sysdeps/unix/sysv/linux/mips/mips64/n32/ld.abilist |  1 +
>  sysdeps/unix/sysv/linux/mips/mips64/n64/ld.abilist |  1 +
>  sysdeps/unix/sysv/linux/nios2/ld.abilist           |  1 +
>  .../unix/sysv/linux/powerpc/powerpc32/ld.abilist   |  1 +
>  .../sysv/linux/powerpc/powerpc64/be/ld.abilist     |  1 +
>  .../sysv/linux/powerpc/powerpc64/le/ld.abilist     |  1 +
>  sysdeps/unix/sysv/linux/riscv/rv32/ld.abilist      |  1 +
>  sysdeps/unix/sysv/linux/riscv/rv64/ld.abilist      |  1 +
>  sysdeps/unix/sysv/linux/s390/s390-32/ld.abilist    |  1 +
>  sysdeps/unix/sysv/linux/s390/s390-64/ld.abilist    |  1 +
>  sysdeps/unix/sysv/linux/sh/be/ld.abilist           |  1 +
>  sysdeps/unix/sysv/linux/sh/le/ld.abilist           |  1 +
>  sysdeps/unix/sysv/linux/sparc/sparc32/ld.abilist   |  1 +
>  sysdeps/unix/sysv/linux/sparc/sparc64/ld.abilist   |  1 +
>  sysdeps/unix/sysv/linux/x86_64/64/ld.abilist       |  1 +
>  sysdeps/unix/sysv/linux/x86_64/x32/ld.abilist      |  1 +
>  33 files changed, 64 insertions(+), 1 deletion(-)
> 
> diff --git a/elf/Makefile b/elf/Makefile
> index ef36008673..48a4698387 100644
> --- a/elf/Makefile
> +++ b/elf/Makefile
> @@ -68,7 +68,7 @@ elide-routines.os = $(all-dl-routines) dl-support enbl-secure dl-origin \
>  rtld-routines	= rtld $(all-dl-routines) dl-sysdep dl-environ dl-minimal \
>    dl-error-minimal dl-conflict dl-hwcaps dl-hwcaps_split dl-hwcaps-subdirs \
>    dl-usage dl-diagnostics dl-diagnostics-kernel dl-diagnostics-cpu \
> -  dl-mutex dl-libc_freeres
> +  dl-mutex dl-libc_freeres dl-compat

OK.

>  all-rtld-routines = $(rtld-routines) $(sysdep-rtld-routines)
>  
>  CFLAGS-dl-runtime.c += -fexceptions -fasynchronous-unwind-tables
> diff --git a/elf/Versions b/elf/Versions
> index 775aab62af..2af210b8f7 100644
> --- a/elf/Versions
> +++ b/elf/Versions
> @@ -48,6 +48,9 @@ ld {
>      # stack canary
>      __stack_chk_guard;
>    }
> +  GLIBC_2.34 {
> +    __rtld_version_placeholder;
> +  }

OK.

>    GLIBC_PRIVATE {
>      # Those are in the dynamic linker, but used by libc.so.
>      __libc_enable_secure;
> diff --git a/elf/dl-compat.c b/elf/dl-compat.c
> new file mode 100644
> index 0000000000..590f2d06b3
> --- /dev/null
> +++ b/elf/dl-compat.c
> @@ -0,0 +1,30 @@
> +/* Placeholder compatibility symbols.
> +   Copyright (C) 2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#include <shlib-compat.h>
> +#include <sys/cdefs.h>
> +
> +void
> +attribute_compat_text_section
> +__attribute_used__
> +__rtld_version_placeholder_1 (void)
> +{
> +}

OK.

> +
> +compat_symbol (ld, __rtld_version_placeholder_1,
> +               __rtld_version_placeholder, GLIBC_2_34);
> diff --git a/sysdeps/mach/hurd/i386/ld.abilist b/sysdeps/mach/hurd/i386/ld.abilist
> index 7e20c5e7ce..ebba31f770 100644
> --- a/sysdeps/mach/hurd/i386/ld.abilist
> +++ b/sysdeps/mach/hurd/i386/ld.abilist
> @@ -16,3 +16,4 @@ GLIBC_2.2.6 _r_debug D 0x14
>  GLIBC_2.2.6 abort F
>  GLIBC_2.3 ___tls_get_addr F
>  GLIBC_2.3 __tls_get_addr F
> +GLIBC_2.34 __rtld_version_placeholder F
> diff --git a/sysdeps/unix/sysv/linux/aarch64/ld.abilist b/sysdeps/unix/sysv/linux/aarch64/ld.abilist
> index 80b2fe6725..b7196a80e2 100644
> --- a/sysdeps/unix/sysv/linux/aarch64/ld.abilist
> +++ b/sysdeps/unix/sysv/linux/aarch64/ld.abilist
> @@ -3,3 +3,4 @@ GLIBC_2.17 __stack_chk_guard D 0x8
>  GLIBC_2.17 __tls_get_addr F
>  GLIBC_2.17 _dl_mcount F
>  GLIBC_2.17 _r_debug D 0x28
> +GLIBC_2.34 __rtld_version_placeholder F
> diff --git a/sysdeps/unix/sysv/linux/alpha/ld.abilist b/sysdeps/unix/sysv/linux/alpha/ld.abilist
> index 98a03f611f..13f7fc74af 100644
> --- a/sysdeps/unix/sysv/linux/alpha/ld.abilist
> +++ b/sysdeps/unix/sysv/linux/alpha/ld.abilist
> @@ -2,4 +2,5 @@ GLIBC_2.0 _r_debug D 0x28
>  GLIBC_2.1 __libc_stack_end D 0x8
>  GLIBC_2.1 _dl_mcount F
>  GLIBC_2.3 __tls_get_addr F
> +GLIBC_2.34 __rtld_version_placeholder F
>  GLIBC_2.4 __stack_chk_guard D 0x8
> diff --git a/sysdeps/unix/sysv/linux/arc/ld.abilist b/sysdeps/unix/sysv/linux/arc/ld.abilist
> index 048f17c848..7284383a6b 100644
> --- a/sysdeps/unix/sysv/linux/arc/ld.abilist
> +++ b/sysdeps/unix/sysv/linux/arc/ld.abilist
> @@ -3,3 +3,4 @@ GLIBC_2.32 __stack_chk_guard D 0x4
>  GLIBC_2.32 __tls_get_addr F
>  GLIBC_2.32 _dl_mcount F
>  GLIBC_2.32 _r_debug D 0x14
> +GLIBC_2.34 __rtld_version_placeholder F
> diff --git a/sysdeps/unix/sysv/linux/arm/be/ld.abilist b/sysdeps/unix/sysv/linux/arm/be/ld.abilist
> index cc8825c3bc..7987bbae11 100644
> --- a/sysdeps/unix/sysv/linux/arm/be/ld.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/be/ld.abilist
> @@ -1,3 +1,4 @@
> +GLIBC_2.34 __rtld_version_placeholder F
>  GLIBC_2.4 __libc_stack_end D 0x4
>  GLIBC_2.4 __stack_chk_guard D 0x4
>  GLIBC_2.4 __tls_get_addr F
> diff --git a/sysdeps/unix/sysv/linux/arm/le/ld.abilist b/sysdeps/unix/sysv/linux/arm/le/ld.abilist
> index cc8825c3bc..7987bbae11 100644
> --- a/sysdeps/unix/sysv/linux/arm/le/ld.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/le/ld.abilist
> @@ -1,3 +1,4 @@
> +GLIBC_2.34 __rtld_version_placeholder F
>  GLIBC_2.4 __libc_stack_end D 0x4
>  GLIBC_2.4 __stack_chk_guard D 0x4
>  GLIBC_2.4 __tls_get_addr F
> diff --git a/sysdeps/unix/sysv/linux/csky/ld.abilist b/sysdeps/unix/sysv/linux/csky/ld.abilist
> index 564ac09737..4939b20631 100644
> --- a/sysdeps/unix/sysv/linux/csky/ld.abilist
> +++ b/sysdeps/unix/sysv/linux/csky/ld.abilist
> @@ -3,3 +3,4 @@ GLIBC_2.29 __stack_chk_guard D 0x4
>  GLIBC_2.29 __tls_get_addr F
>  GLIBC_2.29 _dl_mcount F
>  GLIBC_2.29 _r_debug D 0x14
> +GLIBC_2.34 __rtld_version_placeholder F
> diff --git a/sysdeps/unix/sysv/linux/hppa/ld.abilist b/sysdeps/unix/sysv/linux/hppa/ld.abilist
> index d155a59843..7cc9ebd792 100644
> --- a/sysdeps/unix/sysv/linux/hppa/ld.abilist
> +++ b/sysdeps/unix/sysv/linux/hppa/ld.abilist
> @@ -2,4 +2,5 @@ GLIBC_2.2 __libc_stack_end D 0x4
>  GLIBC_2.2 _dl_mcount F
>  GLIBC_2.2 _r_debug D 0x14
>  GLIBC_2.3 __tls_get_addr F
> +GLIBC_2.34 __rtld_version_placeholder F
>  GLIBC_2.4 __stack_chk_guard D 0x4
> diff --git a/sysdeps/unix/sysv/linux/i386/ld.abilist b/sysdeps/unix/sysv/linux/i386/ld.abilist
> index 0478e22071..e8d187b14d 100644
> --- a/sysdeps/unix/sysv/linux/i386/ld.abilist
> +++ b/sysdeps/unix/sysv/linux/i386/ld.abilist
> @@ -3,3 +3,4 @@ GLIBC_2.1 __libc_stack_end D 0x4
>  GLIBC_2.1 _dl_mcount F
>  GLIBC_2.3 ___tls_get_addr F
>  GLIBC_2.3 __tls_get_addr F
> +GLIBC_2.34 __rtld_version_placeholder F
> diff --git a/sysdeps/unix/sysv/linux/ia64/ld.abilist b/sysdeps/unix/sysv/linux/ia64/ld.abilist
> index 33f91199bf..be5122650a 100644
> --- a/sysdeps/unix/sysv/linux/ia64/ld.abilist
> +++ b/sysdeps/unix/sysv/linux/ia64/ld.abilist
> @@ -2,3 +2,4 @@ GLIBC_2.2 __libc_stack_end D 0x8
>  GLIBC_2.2 _dl_mcount F
>  GLIBC_2.2 _r_debug D 0x28
>  GLIBC_2.3 __tls_get_addr F
> +GLIBC_2.34 __rtld_version_placeholder F
> diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/ld.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/ld.abilist
> index cc8825c3bc..7987bbae11 100644
> --- a/sysdeps/unix/sysv/linux/m68k/coldfire/ld.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/ld.abilist
> @@ -1,3 +1,4 @@
> +GLIBC_2.34 __rtld_version_placeholder F
>  GLIBC_2.4 __libc_stack_end D 0x4
>  GLIBC_2.4 __stack_chk_guard D 0x4
>  GLIBC_2.4 __tls_get_addr F
> diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/ld.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/ld.abilist
> index 3ba474c27f..4f2854edf7 100644
> --- a/sysdeps/unix/sysv/linux/m68k/m680x0/ld.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/ld.abilist
> @@ -2,4 +2,5 @@ GLIBC_2.0 _r_debug D 0x14
>  GLIBC_2.1 __libc_stack_end D 0x4
>  GLIBC_2.1 _dl_mcount F
>  GLIBC_2.3 __tls_get_addr F
> +GLIBC_2.34 __rtld_version_placeholder F
>  GLIBC_2.4 __stack_chk_guard D 0x4
> diff --git a/sysdeps/unix/sysv/linux/microblaze/ld.abilist b/sysdeps/unix/sysv/linux/microblaze/ld.abilist
> index a4933c3541..9f0fdeca38 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/ld.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/ld.abilist
> @@ -3,3 +3,4 @@ GLIBC_2.18 __stack_chk_guard D 0x4
>  GLIBC_2.18 __tls_get_addr F
>  GLIBC_2.18 _dl_mcount F
>  GLIBC_2.18 _r_debug D 0x14
> +GLIBC_2.34 __rtld_version_placeholder F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/ld.abilist b/sysdeps/unix/sysv/linux/mips/mips32/ld.abilist
> index be09641a48..f750067d5c 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips32/ld.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/ld.abilist
> @@ -2,4 +2,5 @@ GLIBC_2.0 _r_debug D 0x14
>  GLIBC_2.2 __libc_stack_end D 0x4
>  GLIBC_2.2 _dl_mcount F
>  GLIBC_2.3 __tls_get_addr F
> +GLIBC_2.34 __rtld_version_placeholder F
>  GLIBC_2.4 __stack_chk_guard D 0x4
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/ld.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/ld.abilist
> index be09641a48..f750067d5c 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/ld.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/ld.abilist
> @@ -2,4 +2,5 @@ GLIBC_2.0 _r_debug D 0x14
>  GLIBC_2.2 __libc_stack_end D 0x4
>  GLIBC_2.2 _dl_mcount F
>  GLIBC_2.3 __tls_get_addr F
> +GLIBC_2.34 __rtld_version_placeholder F
>  GLIBC_2.4 __stack_chk_guard D 0x4
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/ld.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/ld.abilist
> index 1ea36e13f2..2fba6a9b6e 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/ld.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/ld.abilist
> @@ -2,4 +2,5 @@ GLIBC_2.0 _r_debug D 0x28
>  GLIBC_2.2 __libc_stack_end D 0x8
>  GLIBC_2.2 _dl_mcount F
>  GLIBC_2.3 __tls_get_addr F
> +GLIBC_2.34 __rtld_version_placeholder F
>  GLIBC_2.4 __stack_chk_guard D 0x8
> diff --git a/sysdeps/unix/sysv/linux/nios2/ld.abilist b/sysdeps/unix/sysv/linux/nios2/ld.abilist
> index 52178802dd..57dfad5a53 100644
> --- a/sysdeps/unix/sysv/linux/nios2/ld.abilist
> +++ b/sysdeps/unix/sysv/linux/nios2/ld.abilist
> @@ -3,3 +3,4 @@ GLIBC_2.21 __stack_chk_guard D 0x4
>  GLIBC_2.21 __tls_get_addr F
>  GLIBC_2.21 _dl_mcount F
>  GLIBC_2.21 _r_debug D 0x14
> +GLIBC_2.34 __rtld_version_placeholder F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/ld.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/ld.abilist
> index 4bbfba7a61..e896607392 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/ld.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/ld.abilist
> @@ -4,3 +4,4 @@ GLIBC_2.1 _dl_mcount F
>  GLIBC_2.22 __tls_get_addr_opt F
>  GLIBC_2.23 __parse_hwcap_and_convert_at_platform F
>  GLIBC_2.3 __tls_get_addr F
> +GLIBC_2.34 __rtld_version_placeholder F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/ld.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/ld.abilist
> index 283fb4510b..ce0bc63959 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/ld.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/ld.abilist
> @@ -4,3 +4,4 @@ GLIBC_2.3 __libc_stack_end D 0x8
>  GLIBC_2.3 __tls_get_addr F
>  GLIBC_2.3 _dl_mcount F
>  GLIBC_2.3 _r_debug D 0x28
> +GLIBC_2.34 __rtld_version_placeholder F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/ld.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/ld.abilist
> index b1f313c7cd..65b22674d2 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/ld.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/ld.abilist
> @@ -4,3 +4,4 @@ GLIBC_2.17 _dl_mcount F
>  GLIBC_2.17 _r_debug D 0x28
>  GLIBC_2.22 __tls_get_addr_opt F
>  GLIBC_2.23 __parse_hwcap_and_convert_at_platform F
> +GLIBC_2.34 __rtld_version_placeholder F
> diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/ld.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/ld.abilist
> index 94ca64c43d..5ad4c81d12 100644
> --- a/sysdeps/unix/sysv/linux/riscv/rv32/ld.abilist
> +++ b/sysdeps/unix/sysv/linux/riscv/rv32/ld.abilist
> @@ -3,3 +3,4 @@ GLIBC_2.33 __stack_chk_guard D 0x4
>  GLIBC_2.33 __tls_get_addr F
>  GLIBC_2.33 _dl_mcount F
>  GLIBC_2.33 _r_debug D 0x14
> +GLIBC_2.34 __rtld_version_placeholder F
> diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/ld.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/ld.abilist
> index 845f356c3c..479efdea9b 100644
> --- a/sysdeps/unix/sysv/linux/riscv/rv64/ld.abilist
> +++ b/sysdeps/unix/sysv/linux/riscv/rv64/ld.abilist
> @@ -3,3 +3,4 @@ GLIBC_2.27 __stack_chk_guard D 0x8
>  GLIBC_2.27 __tls_get_addr F
>  GLIBC_2.27 _dl_mcount F
>  GLIBC_2.27 _r_debug D 0x28
> +GLIBC_2.34 __rtld_version_placeholder F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/ld.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/ld.abilist
> index b56f005beb..d5ecb636bb 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-32/ld.abilist
> +++ b/sysdeps/unix/sysv/linux/s390/s390-32/ld.abilist
> @@ -2,3 +2,4 @@ GLIBC_2.0 _r_debug D 0x14
>  GLIBC_2.1 __libc_stack_end D 0x4
>  GLIBC_2.1 _dl_mcount F
>  GLIBC_2.3 __tls_get_offset F
> +GLIBC_2.34 __rtld_version_placeholder F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/ld.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/ld.abilist
> index 6f788a086d..62a5e1d99a 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-64/ld.abilist
> +++ b/sysdeps/unix/sysv/linux/s390/s390-64/ld.abilist
> @@ -2,3 +2,4 @@ GLIBC_2.2 __libc_stack_end D 0x8
>  GLIBC_2.2 _dl_mcount F
>  GLIBC_2.2 _r_debug D 0x28
>  GLIBC_2.3 __tls_get_offset F
> +GLIBC_2.34 __rtld_version_placeholder F
> diff --git a/sysdeps/unix/sysv/linux/sh/be/ld.abilist b/sysdeps/unix/sysv/linux/sh/be/ld.abilist
> index d155a59843..7cc9ebd792 100644
> --- a/sysdeps/unix/sysv/linux/sh/be/ld.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/be/ld.abilist
> @@ -2,4 +2,5 @@ GLIBC_2.2 __libc_stack_end D 0x4
>  GLIBC_2.2 _dl_mcount F
>  GLIBC_2.2 _r_debug D 0x14
>  GLIBC_2.3 __tls_get_addr F
> +GLIBC_2.34 __rtld_version_placeholder F
>  GLIBC_2.4 __stack_chk_guard D 0x4
> diff --git a/sysdeps/unix/sysv/linux/sh/le/ld.abilist b/sysdeps/unix/sysv/linux/sh/le/ld.abilist
> index d155a59843..7cc9ebd792 100644
> --- a/sysdeps/unix/sysv/linux/sh/le/ld.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/le/ld.abilist
> @@ -2,4 +2,5 @@ GLIBC_2.2 __libc_stack_end D 0x4
>  GLIBC_2.2 _dl_mcount F
>  GLIBC_2.2 _r_debug D 0x14
>  GLIBC_2.3 __tls_get_addr F
> +GLIBC_2.34 __rtld_version_placeholder F
>  GLIBC_2.4 __stack_chk_guard D 0x4
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/ld.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/ld.abilist
> index 0c6610e3c2..2e60543498 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc32/ld.abilist
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/ld.abilist
> @@ -2,3 +2,4 @@ GLIBC_2.0 _r_debug D 0x14
>  GLIBC_2.1 __libc_stack_end D 0x4
>  GLIBC_2.1 _dl_mcount F
>  GLIBC_2.3 __tls_get_addr F
> +GLIBC_2.34 __rtld_version_placeholder F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/ld.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/ld.abilist
> index 33f91199bf..be5122650a 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc64/ld.abilist
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/ld.abilist
> @@ -2,3 +2,4 @@ GLIBC_2.2 __libc_stack_end D 0x8
>  GLIBC_2.2 _dl_mcount F
>  GLIBC_2.2 _r_debug D 0x28
>  GLIBC_2.3 __tls_get_addr F
> +GLIBC_2.34 __rtld_version_placeholder F
> diff --git a/sysdeps/unix/sysv/linux/x86_64/64/ld.abilist b/sysdeps/unix/sysv/linux/x86_64/64/ld.abilist
> index d3cdf7611e..afddaec57c 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/64/ld.abilist
> +++ b/sysdeps/unix/sysv/linux/x86_64/64/ld.abilist
> @@ -2,3 +2,4 @@ GLIBC_2.2.5 __libc_stack_end D 0x8
>  GLIBC_2.2.5 _dl_mcount F
>  GLIBC_2.2.5 _r_debug D 0x28
>  GLIBC_2.3 __tls_get_addr F
> +GLIBC_2.34 __rtld_version_placeholder F
> diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/ld.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/ld.abilist
> index c70bccf782..defc488d13 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/x32/ld.abilist
> +++ b/sysdeps/unix/sysv/linux/x86_64/x32/ld.abilist
> @@ -2,3 +2,4 @@ GLIBC_2.16 __libc_stack_end D 0x4
>  GLIBC_2.16 __tls_get_addr F
>  GLIBC_2.16 _dl_mcount F
>  GLIBC_2.16 _r_debug D 0x14
> +GLIBC_2.34 __rtld_version_placeholder F
> 

OK.
diff mbox series

Patch

diff --git a/elf/Makefile b/elf/Makefile
index ef36008673..48a4698387 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -68,7 +68,7 @@  elide-routines.os = $(all-dl-routines) dl-support enbl-secure dl-origin \
 rtld-routines	= rtld $(all-dl-routines) dl-sysdep dl-environ dl-minimal \
   dl-error-minimal dl-conflict dl-hwcaps dl-hwcaps_split dl-hwcaps-subdirs \
   dl-usage dl-diagnostics dl-diagnostics-kernel dl-diagnostics-cpu \
-  dl-mutex dl-libc_freeres
+  dl-mutex dl-libc_freeres dl-compat
 all-rtld-routines = $(rtld-routines) $(sysdep-rtld-routines)
 
 CFLAGS-dl-runtime.c += -fexceptions -fasynchronous-unwind-tables
diff --git a/elf/Versions b/elf/Versions
index 775aab62af..2af210b8f7 100644
--- a/elf/Versions
+++ b/elf/Versions
@@ -48,6 +48,9 @@  ld {
     # stack canary
     __stack_chk_guard;
   }
+  GLIBC_2.34 {
+    __rtld_version_placeholder;
+  }
   GLIBC_PRIVATE {
     # Those are in the dynamic linker, but used by libc.so.
     __libc_enable_secure;
diff --git a/elf/dl-compat.c b/elf/dl-compat.c
new file mode 100644
index 0000000000..590f2d06b3
--- /dev/null
+++ b/elf/dl-compat.c
@@ -0,0 +1,30 @@ 
+/* Placeholder compatibility symbols.
+   Copyright (C) 2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <shlib-compat.h>
+#include <sys/cdefs.h>
+
+void
+attribute_compat_text_section
+__attribute_used__
+__rtld_version_placeholder_1 (void)
+{
+}
+
+compat_symbol (ld, __rtld_version_placeholder_1,
+               __rtld_version_placeholder, GLIBC_2_34);
diff --git a/sysdeps/mach/hurd/i386/ld.abilist b/sysdeps/mach/hurd/i386/ld.abilist
index 7e20c5e7ce..ebba31f770 100644
--- a/sysdeps/mach/hurd/i386/ld.abilist
+++ b/sysdeps/mach/hurd/i386/ld.abilist
@@ -16,3 +16,4 @@  GLIBC_2.2.6 _r_debug D 0x14
 GLIBC_2.2.6 abort F
 GLIBC_2.3 ___tls_get_addr F
 GLIBC_2.3 __tls_get_addr F
+GLIBC_2.34 __rtld_version_placeholder F
diff --git a/sysdeps/unix/sysv/linux/aarch64/ld.abilist b/sysdeps/unix/sysv/linux/aarch64/ld.abilist
index 80b2fe6725..b7196a80e2 100644
--- a/sysdeps/unix/sysv/linux/aarch64/ld.abilist
+++ b/sysdeps/unix/sysv/linux/aarch64/ld.abilist
@@ -3,3 +3,4 @@  GLIBC_2.17 __stack_chk_guard D 0x8
 GLIBC_2.17 __tls_get_addr F
 GLIBC_2.17 _dl_mcount F
 GLIBC_2.17 _r_debug D 0x28
+GLIBC_2.34 __rtld_version_placeholder F
diff --git a/sysdeps/unix/sysv/linux/alpha/ld.abilist b/sysdeps/unix/sysv/linux/alpha/ld.abilist
index 98a03f611f..13f7fc74af 100644
--- a/sysdeps/unix/sysv/linux/alpha/ld.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/ld.abilist
@@ -2,4 +2,5 @@  GLIBC_2.0 _r_debug D 0x28
 GLIBC_2.1 __libc_stack_end D 0x8
 GLIBC_2.1 _dl_mcount F
 GLIBC_2.3 __tls_get_addr F
+GLIBC_2.34 __rtld_version_placeholder F
 GLIBC_2.4 __stack_chk_guard D 0x8
diff --git a/sysdeps/unix/sysv/linux/arc/ld.abilist b/sysdeps/unix/sysv/linux/arc/ld.abilist
index 048f17c848..7284383a6b 100644
--- a/sysdeps/unix/sysv/linux/arc/ld.abilist
+++ b/sysdeps/unix/sysv/linux/arc/ld.abilist
@@ -3,3 +3,4 @@  GLIBC_2.32 __stack_chk_guard D 0x4
 GLIBC_2.32 __tls_get_addr F
 GLIBC_2.32 _dl_mcount F
 GLIBC_2.32 _r_debug D 0x14
+GLIBC_2.34 __rtld_version_placeholder F
diff --git a/sysdeps/unix/sysv/linux/arm/be/ld.abilist b/sysdeps/unix/sysv/linux/arm/be/ld.abilist
index cc8825c3bc..7987bbae11 100644
--- a/sysdeps/unix/sysv/linux/arm/be/ld.abilist
+++ b/sysdeps/unix/sysv/linux/arm/be/ld.abilist
@@ -1,3 +1,4 @@ 
+GLIBC_2.34 __rtld_version_placeholder F
 GLIBC_2.4 __libc_stack_end D 0x4
 GLIBC_2.4 __stack_chk_guard D 0x4
 GLIBC_2.4 __tls_get_addr F
diff --git a/sysdeps/unix/sysv/linux/arm/le/ld.abilist b/sysdeps/unix/sysv/linux/arm/le/ld.abilist
index cc8825c3bc..7987bbae11 100644
--- a/sysdeps/unix/sysv/linux/arm/le/ld.abilist
+++ b/sysdeps/unix/sysv/linux/arm/le/ld.abilist
@@ -1,3 +1,4 @@ 
+GLIBC_2.34 __rtld_version_placeholder F
 GLIBC_2.4 __libc_stack_end D 0x4
 GLIBC_2.4 __stack_chk_guard D 0x4
 GLIBC_2.4 __tls_get_addr F
diff --git a/sysdeps/unix/sysv/linux/csky/ld.abilist b/sysdeps/unix/sysv/linux/csky/ld.abilist
index 564ac09737..4939b20631 100644
--- a/sysdeps/unix/sysv/linux/csky/ld.abilist
+++ b/sysdeps/unix/sysv/linux/csky/ld.abilist
@@ -3,3 +3,4 @@  GLIBC_2.29 __stack_chk_guard D 0x4
 GLIBC_2.29 __tls_get_addr F
 GLIBC_2.29 _dl_mcount F
 GLIBC_2.29 _r_debug D 0x14
+GLIBC_2.34 __rtld_version_placeholder F
diff --git a/sysdeps/unix/sysv/linux/hppa/ld.abilist b/sysdeps/unix/sysv/linux/hppa/ld.abilist
index d155a59843..7cc9ebd792 100644
--- a/sysdeps/unix/sysv/linux/hppa/ld.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/ld.abilist
@@ -2,4 +2,5 @@  GLIBC_2.2 __libc_stack_end D 0x4
 GLIBC_2.2 _dl_mcount F
 GLIBC_2.2 _r_debug D 0x14
 GLIBC_2.3 __tls_get_addr F
+GLIBC_2.34 __rtld_version_placeholder F
 GLIBC_2.4 __stack_chk_guard D 0x4
diff --git a/sysdeps/unix/sysv/linux/i386/ld.abilist b/sysdeps/unix/sysv/linux/i386/ld.abilist
index 0478e22071..e8d187b14d 100644
--- a/sysdeps/unix/sysv/linux/i386/ld.abilist
+++ b/sysdeps/unix/sysv/linux/i386/ld.abilist
@@ -3,3 +3,4 @@  GLIBC_2.1 __libc_stack_end D 0x4
 GLIBC_2.1 _dl_mcount F
 GLIBC_2.3 ___tls_get_addr F
 GLIBC_2.3 __tls_get_addr F
+GLIBC_2.34 __rtld_version_placeholder F
diff --git a/sysdeps/unix/sysv/linux/ia64/ld.abilist b/sysdeps/unix/sysv/linux/ia64/ld.abilist
index 33f91199bf..be5122650a 100644
--- a/sysdeps/unix/sysv/linux/ia64/ld.abilist
+++ b/sysdeps/unix/sysv/linux/ia64/ld.abilist
@@ -2,3 +2,4 @@  GLIBC_2.2 __libc_stack_end D 0x8
 GLIBC_2.2 _dl_mcount F
 GLIBC_2.2 _r_debug D 0x28
 GLIBC_2.3 __tls_get_addr F
+GLIBC_2.34 __rtld_version_placeholder F
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/ld.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/ld.abilist
index cc8825c3bc..7987bbae11 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/ld.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/ld.abilist
@@ -1,3 +1,4 @@ 
+GLIBC_2.34 __rtld_version_placeholder F
 GLIBC_2.4 __libc_stack_end D 0x4
 GLIBC_2.4 __stack_chk_guard D 0x4
 GLIBC_2.4 __tls_get_addr F
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/ld.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/ld.abilist
index 3ba474c27f..4f2854edf7 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/ld.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/ld.abilist
@@ -2,4 +2,5 @@  GLIBC_2.0 _r_debug D 0x14
 GLIBC_2.1 __libc_stack_end D 0x4
 GLIBC_2.1 _dl_mcount F
 GLIBC_2.3 __tls_get_addr F
+GLIBC_2.34 __rtld_version_placeholder F
 GLIBC_2.4 __stack_chk_guard D 0x4
diff --git a/sysdeps/unix/sysv/linux/microblaze/ld.abilist b/sysdeps/unix/sysv/linux/microblaze/ld.abilist
index a4933c3541..9f0fdeca38 100644
--- a/sysdeps/unix/sysv/linux/microblaze/ld.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/ld.abilist
@@ -3,3 +3,4 @@  GLIBC_2.18 __stack_chk_guard D 0x4
 GLIBC_2.18 __tls_get_addr F
 GLIBC_2.18 _dl_mcount F
 GLIBC_2.18 _r_debug D 0x14
+GLIBC_2.34 __rtld_version_placeholder F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/ld.abilist b/sysdeps/unix/sysv/linux/mips/mips32/ld.abilist
index be09641a48..f750067d5c 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/ld.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/ld.abilist
@@ -2,4 +2,5 @@  GLIBC_2.0 _r_debug D 0x14
 GLIBC_2.2 __libc_stack_end D 0x4
 GLIBC_2.2 _dl_mcount F
 GLIBC_2.3 __tls_get_addr F
+GLIBC_2.34 __rtld_version_placeholder F
 GLIBC_2.4 __stack_chk_guard D 0x4
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/ld.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/ld.abilist
index be09641a48..f750067d5c 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/ld.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/ld.abilist
@@ -2,4 +2,5 @@  GLIBC_2.0 _r_debug D 0x14
 GLIBC_2.2 __libc_stack_end D 0x4
 GLIBC_2.2 _dl_mcount F
 GLIBC_2.3 __tls_get_addr F
+GLIBC_2.34 __rtld_version_placeholder F
 GLIBC_2.4 __stack_chk_guard D 0x4
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/ld.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/ld.abilist
index 1ea36e13f2..2fba6a9b6e 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/ld.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/ld.abilist
@@ -2,4 +2,5 @@  GLIBC_2.0 _r_debug D 0x28
 GLIBC_2.2 __libc_stack_end D 0x8
 GLIBC_2.2 _dl_mcount F
 GLIBC_2.3 __tls_get_addr F
+GLIBC_2.34 __rtld_version_placeholder F
 GLIBC_2.4 __stack_chk_guard D 0x8
diff --git a/sysdeps/unix/sysv/linux/nios2/ld.abilist b/sysdeps/unix/sysv/linux/nios2/ld.abilist
index 52178802dd..57dfad5a53 100644
--- a/sysdeps/unix/sysv/linux/nios2/ld.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/ld.abilist
@@ -3,3 +3,4 @@  GLIBC_2.21 __stack_chk_guard D 0x4
 GLIBC_2.21 __tls_get_addr F
 GLIBC_2.21 _dl_mcount F
 GLIBC_2.21 _r_debug D 0x14
+GLIBC_2.34 __rtld_version_placeholder F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/ld.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/ld.abilist
index 4bbfba7a61..e896607392 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/ld.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/ld.abilist
@@ -4,3 +4,4 @@  GLIBC_2.1 _dl_mcount F
 GLIBC_2.22 __tls_get_addr_opt F
 GLIBC_2.23 __parse_hwcap_and_convert_at_platform F
 GLIBC_2.3 __tls_get_addr F
+GLIBC_2.34 __rtld_version_placeholder F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/ld.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/ld.abilist
index 283fb4510b..ce0bc63959 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/ld.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/ld.abilist
@@ -4,3 +4,4 @@  GLIBC_2.3 __libc_stack_end D 0x8
 GLIBC_2.3 __tls_get_addr F
 GLIBC_2.3 _dl_mcount F
 GLIBC_2.3 _r_debug D 0x28
+GLIBC_2.34 __rtld_version_placeholder F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/ld.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/ld.abilist
index b1f313c7cd..65b22674d2 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/ld.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/ld.abilist
@@ -4,3 +4,4 @@  GLIBC_2.17 _dl_mcount F
 GLIBC_2.17 _r_debug D 0x28
 GLIBC_2.22 __tls_get_addr_opt F
 GLIBC_2.23 __parse_hwcap_and_convert_at_platform F
+GLIBC_2.34 __rtld_version_placeholder F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/ld.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/ld.abilist
index 94ca64c43d..5ad4c81d12 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv32/ld.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv32/ld.abilist
@@ -3,3 +3,4 @@  GLIBC_2.33 __stack_chk_guard D 0x4
 GLIBC_2.33 __tls_get_addr F
 GLIBC_2.33 _dl_mcount F
 GLIBC_2.33 _r_debug D 0x14
+GLIBC_2.34 __rtld_version_placeholder F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/ld.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/ld.abilist
index 845f356c3c..479efdea9b 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv64/ld.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/ld.abilist
@@ -3,3 +3,4 @@  GLIBC_2.27 __stack_chk_guard D 0x8
 GLIBC_2.27 __tls_get_addr F
 GLIBC_2.27 _dl_mcount F
 GLIBC_2.27 _r_debug D 0x28
+GLIBC_2.34 __rtld_version_placeholder F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/ld.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/ld.abilist
index b56f005beb..d5ecb636bb 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/ld.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/ld.abilist
@@ -2,3 +2,4 @@  GLIBC_2.0 _r_debug D 0x14
 GLIBC_2.1 __libc_stack_end D 0x4
 GLIBC_2.1 _dl_mcount F
 GLIBC_2.3 __tls_get_offset F
+GLIBC_2.34 __rtld_version_placeholder F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/ld.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/ld.abilist
index 6f788a086d..62a5e1d99a 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/ld.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/ld.abilist
@@ -2,3 +2,4 @@  GLIBC_2.2 __libc_stack_end D 0x8
 GLIBC_2.2 _dl_mcount F
 GLIBC_2.2 _r_debug D 0x28
 GLIBC_2.3 __tls_get_offset F
+GLIBC_2.34 __rtld_version_placeholder F
diff --git a/sysdeps/unix/sysv/linux/sh/be/ld.abilist b/sysdeps/unix/sysv/linux/sh/be/ld.abilist
index d155a59843..7cc9ebd792 100644
--- a/sysdeps/unix/sysv/linux/sh/be/ld.abilist
+++ b/sysdeps/unix/sysv/linux/sh/be/ld.abilist
@@ -2,4 +2,5 @@  GLIBC_2.2 __libc_stack_end D 0x4
 GLIBC_2.2 _dl_mcount F
 GLIBC_2.2 _r_debug D 0x14
 GLIBC_2.3 __tls_get_addr F
+GLIBC_2.34 __rtld_version_placeholder F
 GLIBC_2.4 __stack_chk_guard D 0x4
diff --git a/sysdeps/unix/sysv/linux/sh/le/ld.abilist b/sysdeps/unix/sysv/linux/sh/le/ld.abilist
index d155a59843..7cc9ebd792 100644
--- a/sysdeps/unix/sysv/linux/sh/le/ld.abilist
+++ b/sysdeps/unix/sysv/linux/sh/le/ld.abilist
@@ -2,4 +2,5 @@  GLIBC_2.2 __libc_stack_end D 0x4
 GLIBC_2.2 _dl_mcount F
 GLIBC_2.2 _r_debug D 0x14
 GLIBC_2.3 __tls_get_addr F
+GLIBC_2.34 __rtld_version_placeholder F
 GLIBC_2.4 __stack_chk_guard D 0x4
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/ld.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/ld.abilist
index 0c6610e3c2..2e60543498 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/ld.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/ld.abilist
@@ -2,3 +2,4 @@  GLIBC_2.0 _r_debug D 0x14
 GLIBC_2.1 __libc_stack_end D 0x4
 GLIBC_2.1 _dl_mcount F
 GLIBC_2.3 __tls_get_addr F
+GLIBC_2.34 __rtld_version_placeholder F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/ld.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/ld.abilist
index 33f91199bf..be5122650a 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/ld.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/ld.abilist
@@ -2,3 +2,4 @@  GLIBC_2.2 __libc_stack_end D 0x8
 GLIBC_2.2 _dl_mcount F
 GLIBC_2.2 _r_debug D 0x28
 GLIBC_2.3 __tls_get_addr F
+GLIBC_2.34 __rtld_version_placeholder F
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/ld.abilist b/sysdeps/unix/sysv/linux/x86_64/64/ld.abilist
index d3cdf7611e..afddaec57c 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/ld.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/ld.abilist
@@ -2,3 +2,4 @@  GLIBC_2.2.5 __libc_stack_end D 0x8
 GLIBC_2.2.5 _dl_mcount F
 GLIBC_2.2.5 _r_debug D 0x28
 GLIBC_2.3 __tls_get_addr F
+GLIBC_2.34 __rtld_version_placeholder F
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/ld.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/ld.abilist
index c70bccf782..defc488d13 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/ld.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/ld.abilist
@@ -2,3 +2,4 @@  GLIBC_2.16 __libc_stack_end D 0x4
 GLIBC_2.16 __tls_get_addr F
 GLIBC_2.16 _dl_mcount F
 GLIBC_2.16 _r_debug D 0x14
+GLIBC_2.34 __rtld_version_placeholder F