shared libraries linked into executable when they are not neccessary
Jose E. Marchesi
jose.marchesi@oracle.com
Thu Oct 23 14:56:25 GMT 2025
What DSO is being linked that you don't expect?
There are some DSOs that are linked in every non-static executable, such
as ld-linux-x86-64.so, linux-vdso.so, and likely libc.so.6, libm etc.
> Hi,
>
> Not sure if this is the right list for asking this question. If it's not,
> please point me to the right list.
>
> I am confused as to why a shared library - which isn't needed by
> an executable - is linked in.
>
> I am using binutils 2.39
>
> The link line contains
>
> -fuse-ld=gold -Wl,--as-needed -Wl,-Map,map.txt -Wl,--cref
>
> When I look at map.txt, I cannot find why the shared library is
> necessary. What should I look for?
>
> This is happening with binutils 2.45 as well.
>
> Thanks,
>
> Tom
More information about the Binutils
mailing list