ldconfig is statically linked or dynamiclly linked

Adhemerval Zanella Netto adhemerval.zanella@linaro.org
Thu Sep 1 13:15:13 GMT 2022



On 01/09/22 09:22, Siddhesh Poyarekar via Libc-help wrote:
> On Thu, Sep 1, 2022 at 5:42 AM Lv Ying via Libc-help
> <libc-help@sourceware.org> wrote:
>>     I am confused when exec file ldconfig and ldd ldconfig on CentOS 8(glibc-2.28):
>>
>> # which ldconfig
>> /usr/sbin/ldconfig
>> # file /usr/sbin/ldconfig
>> /usr/sbin/ldconfig: ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), dynamically linked, for GNU/Linux 3.2.0, BuildID[sha1]=90ddd9a3e194fb2ec4edd5184d9fca4df45af636, not stripped
> 
> ldconfig is a statically linked PIE executable.  The file command
> tends to claim that PIE executables are shared objects, which is what
> you're seeing here.
> 
> Sid

I think the issue is the file command, using a more recent one it does show
that ldconfig is a static-pie:

$ file elf/ldconfig
elf/ldconfig: ELF 64-bit LSB pie executable, x86-64, version 1 (GNU/Linux), 
static-pie linked, for GNU/Linux 3.2.0, with debug_info, not stripped

$ readelf -l elf/ldconfig  | grep INTERP
$


More information about the Libc-help mailing list