1 回答

TA貢獻1836條經驗 獲得超3個贊
由于-u開關,它正在打印。在ldd的手冊頁中
-u, --unused
? ? ? ? ? Print unused direct dependencies.? (Since glibc 2.3.4.)
什么是未使用的直接依賴項(這對我來說是矛盾的)?
這是恕我直言->庫您建立二進制文件,這是沒有必要的。IE
gcc -L<LD_PATH> -Wall -o assistant assistant.c -lA -lB -lC
它將所有ABC列為依賴項,但它們可能實際上未以二進制形式使用。主要原因是Makefile中通用LDFLAGS。
是否可以找出Qt Assistant是否確實需要未使用的直接依賴項(然后再啟動它并等待錯誤)?
不,我認為,只有在調用特定函數時才可以使用它。還有機會您可以使用此功能,不會看到錯誤。不過,如果您決定這樣做。有一種瘋狂的方式。列出所有調用的函數,然后檢查需要哪些所有庫。(不確定這一點,但我認為基于類似的邏輯ldd可以打印此內容。)根據手冊頁ldd可能運行二進制文件。因此,基本上可以說是您提到的一種情況。但不廣泛。
?Be aware,? however,? that? in some circumstances, some versions of
?ldd may attempt to obtain the dependency information by directly?
?executing? the program.? Thus, you should never employ ldd on an
?untrusted executable,
?since this may result in the execution? of? arbitrary? code.
上面的命令行之間到底有什么區別?為什么第一個列出libQt5Sql但第二個沒有列出?
差異是 -r
? ? ? ?-r, --function-relocs
? ? ? ? ? Perform relocations for both data? objects? and? functions,? and
? ? ? ? ? report any missing objects or functions (ELF only).
簡而言之,它處理加載的庫函數。建議使用ldd -u -r在這個錯誤在RedHat。
- 1 回答
- 0 關注
- 321 瀏覽
添加回答
舉報