Page MenuHomeFreeBSD

ldd: remove '[preloaded]' marker for the preloaded objects
ClosedPublic

Authored by kib on Sep 18 2022, 12:56 AM.
Tags
None
Referenced Files
F153386934: D36616.diff
Mon, Apr 20, 8:57 PM
F153348564: D36616.id110847.diff
Mon, Apr 20, 3:26 PM
Unknown Object (File)
Wed, Apr 15, 12:32 PM
Unknown Object (File)
Wed, Apr 15, 7:28 AM
Unknown Object (File)
Thu, Apr 9, 12:04 AM
Unknown Object (File)
Fri, Apr 3, 7:08 AM
Unknown Object (File)
Fri, Apr 3, 7:04 AM
Unknown Object (File)
Thu, Apr 2, 5:10 AM

Details

Summary
Instead, use special format2 for printing the preloaded objects (and
vdso), which does not include DT_NEEDED, since there is no object
needing the printed one.

In this way, the output is more compatible with glibc.

Example:
LD_PRELOAD=/lib/libthr.so.3 LD_TRACE_LOADED_OBJECTS=1 /libexec/ld-elf.so.1 /bin/ls
        libutil.so.9 => /lib/libutil.so.9 (0x801099000)
        libncursesw.so.9 => /lib/libncursesw.so.9 (0x8010b0000)
        libc.so.7 => /lib/libc.so.7 (0x801123000)
        [vdso] (0x7ffffffff000)
        /lib/libthr.so.3 (0x80106c000)
Note the absense of the part before and including '=>' for preloaded
libthr.so.3, and for vdso.

PR:     265750

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable