On Mon, 24 Nov 2025, H.J. Lu wrote: > On Sat, Nov 22, 2025 at 5:47 PM Richard Biener <[email protected]> wrote: > > > > > > > > > Am 22.11.2025 um 00:29 schrieb H.J. Lu <[email protected]>: > > > > > > On Sat, Nov 22, 2025 at 5:33 AM Florian Weimer <[email protected]> > > > wrote: > > >> > > >> * Richard Biener: > > >> > > >>> +/* When the glibc we build against does not have dl_find_object > > >>> tentatively > > >>> + declare the relevant bits of the structure here and use a weak > > >>> declaration > > >>> + so we can perform a runtime check on its presence. */ > > >>> +#if !defined(DLFO_STRUCT_HAS_EH_DBASE) > > >> > > >> I agree with Jakub that this should be restricted to __GLIBC__. > > >> > > >> This works for the narrow case that _dl_find_object is not available at > > >> build time and becomes available at run time. Extending this to make it > > >> optional at run time when it was available and build time does not work > > >> quite work because BFD ld does not support weak symbol versions (the > > > > > > If a symbol isn't available at link-time, how can it be versioned? At > > > most, > > > some versions for BFD linker will make it with an empty version. Does > > > ld.so > > > disallow undefined weak symbols with an empty version? > > > > I suppose if glibc would change the _dl_find_object ABI by providing a new > > default version but keeping a compat one the weak symbol would pick up the > > new default at runtime as it is not possible to have a weak UNDEF binding > > to a specific version? > > Yes, it is possible. See: > > https://patchwork.sourceware.org/project/binutils/patch/came9rorn7nycxb77kffwmvo7ury89y9mms8ouyus7x9pn0b...@mail.gmail.com/ > > for how it works.
Ah, nice. Of course _dl_find_object isn't versioned in the first place it seems ... which means this isn't a concern as glibc cannot change the ABI of it. Richard. -- Richard Biener <[email protected]> SUSE Software Solutions Germany GmbH, Frankenstrasse 146, 90461 Nuernberg, Germany; GF: Jochen Jaser, Andrew McDonald, Werner Knoblich; (HRB 36809, AG Nuernberg)
