Skip to content
Advertisement

How does the dynamic loader load libs with correct arch version

For the aarch64 based system, if I provide both arm and arm64 version of library libtest.so in different path, and added the paths into /etc/ld.so.conf.

I want to know if a application depends on this library, how does the loader find out the correct version of libtest.so ?

Basically since both paths are present in ld.so.cache, so does the loader will choose according the arch of app ? Or is there any rule needed when adding path into ld.so.conf for different arch?

I want to how does it work and many thanks for any information.

Advertisement

Answer

I just test it on the system, ldconfig -p output the two libraries but pointing to different place, then ld will use the one library matched with target’s arch.

So that ld will match lib by arch, right?

If something wrong please correct me.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement