Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the ldd under Linux?

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "what is ldd under Linux". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "what is ldd under Linux"?

1. First of all, ldd is not an executable program, but just a shell script

2. Ldd can display the dependency of the executable module, the principle is by setting a series of environment variables, as follows: LD_TRACE_LOADED_OBJECTS, LD_WARN, LD_BIND_NOW, LD_LIBRARY_VERSION, LD_VERBOSE and so on. When the LD_TRACE_LOADED_OBJECTS environment variable is not empty, any executable program will only display the dependency of the module when it is running, and the program will not actually execute. Or you can test it at the shell terminal, as follows:

(1) export LD_TRACE_LOADED_OBJECTS=1

(2) execute any program, such as ls, to see the running result of the program.

3. Ldd shows the working principle of dependency of executable module, which is realized by ld-linux.so (loader of elf dynamic library). We know that the ld-linux.so module will work before the executable module program and gain control, so when the above environment variables are set, ld-linux.so chooses to display the dependency of the executable module.

4. You can actually execute the ld-linux.so module directly, such as / lib/ld-linux.so.2-- list program (which is equivalent to ldd program)

Onebyte:

The role of ldd: recently, the program has been unable to run, and I would like to use ldd to see which runtime it loads, but because it has been cross-compiled on HOST, it is useless to use ldd on HOST. Since then, there has been no good way. After reading this article today, I suddenly realized that ldd is just a script file, so why don't you just copy it to TARGET? Do it at once, and it really works! It's great to find that the program is missing the library of libqte.so.3. Just copy one from the HOST.

At this point, I believe you have a deeper understanding of "what is ldd under Linux". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report