[PATCH 1/1] elf: Report when found libraries are rejected [BZ #33479]

Ben Boeckel ben.boeckel@kitware.com
Wed Oct 1 13:36:56 GMT 2025


On Wed, Oct 01, 2025 at 09:18:18 -0300, Adhemerval Zanella Netto wrote:
> 
> 
> On 23/09/25 15:27, Ben Boeckel wrote:
> > When debugging library loading issues with `LD_DEBUG`, it can be
> > frustrating to see logs for files in a directory are searched, but the
> > target library is skipped over without any indication of why. Add
> > reporting to all paths which reject a library as `ENOENT`.
> > 
> > Originally created for minimum-OS version detection, but that has since
> > been removed in b46d250656 (Remove kernel version check, 2022-02-21).
> > The remaining codepaths are still useful.
> > 
> > Signed-off-by: Ben Boeckel <ben.boeckel@kitware.com>
> 
> It fails to build [1]:
> 
> dl-load.c: In function 'open_path':
> dl-load.c:1837:39: error: too many arguments for format [-Werror=format-extra-args]
>  1837 |                     _dl_debug_printf ("  refusing to reload shared objects from trusted directories\n",
>       |                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> cc1: all warnings being treated as errors

Gah, that's what I get for thinking it was a trivial addition to make.
Compile tested now.

> I think you meant something like:
> 
>                   if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_LIBS))
>                     _dl_debug_printf ("  refuse to load file=%s, the shared "
>                                       "object cannot be tested for being "
>                                       "SUID or the bit is not set.\n",
>                                       buf);
> 
> Also the bug report points to an unrelated issue [1].

Whoops, grabbed the wrong entry from my history. Will fix.

Thanks,

--Ben


More information about the Libc-alpha mailing list