From 56790098ea763c0e111bb7dad126c4fdbb1c2969 Mon Sep 17 00:00:00 2001 From: Liav A Date: Sun, 17 Sep 2023 10:38:15 +0300 Subject: [PATCH] Utilities: Rename ldd => elfdeps As a preparation to introducing ldd as a symlink to /usr/lib/Loader.so we rename the ldd utility to be elfdeps, at its sole purpose is to list ELF object dependencies, and not how the dynamic loader loads them. --- Base/usr/share/man/man1/{ldd.md => elfdeps.md} | 18 +++++++++--------- Userland/Utilities/CMakeLists.txt | 2 +- Userland/Utilities/{ldd.cpp => elfdeps.cpp} | 0 3 files changed, 10 insertions(+), 10 deletions(-) rename Base/usr/share/man/man1/{ldd.md => elfdeps.md} (53%) rename Userland/Utilities/{ldd.cpp => elfdeps.cpp} (100%) diff --git a/Base/usr/share/man/man1/ldd.md b/Base/usr/share/man/man1/elfdeps.md similarity index 53% rename from Base/usr/share/man/man1/ldd.md rename to Base/usr/share/man/man1/elfdeps.md index d358f0b788..f41d9afc74 100644 --- a/Base/usr/share/man/man1/ldd.md +++ b/Base/usr/share/man/man1/elfdeps.md @@ -1,16 +1,16 @@ ## Name -ldd - list dynamic dependencies +elfdeps - list ELF object dynamic dependencies ## Synopsis ```**sh -$ ldd [-r] [-f] +$ elfdeps [-r] [-f] ``` ## Description -`ldd` prints all dependency libraries of an ELF object. +`elfdeps` prints all dependency libraries of an ELF object. ## Options @@ -24,18 +24,18 @@ $ ldd [-r] [-f] ## Security -In contrast to other OS implementations, the `ldd` binary is completely safe for -usage on untrusted binaries - we only use the `LibELF` code for doing library -resolving, and the actual binary interpreter (when specified) is never called to +The `elfdeps` binary is completely safe for usage on untrusted binaries - +we only use the `LibELF` code for doing library resolving, and the actual +binary interpreter (when specified in an ELF exectuable) is never called to decode the dependency information. ## Examples ```sh # List all dependency libraries for libc.so -$ ldd -f /usr/lib/libc.so +$ elfdeps -f /usr/lib/libc.so # List all dependency libraries for /bin/id -$ ldd /bin/id +$ elfdeps /bin/id # List all dependency libraries for /bin/WindowServer -$ ldd /bin/WindowServer +$ elfdeps /bin/WindowServer ``` diff --git a/Userland/Utilities/CMakeLists.txt b/Userland/Utilities/CMakeLists.txt index d8f43111b8..ad6aff695e 100644 --- a/Userland/Utilities/CMakeLists.txt +++ b/Userland/Utilities/CMakeLists.txt @@ -92,6 +92,7 @@ target_link_libraries(cpp-preprocessor PRIVATE LibCpp) target_link_libraries(diff PRIVATE LibDiff) target_link_libraries(disasm PRIVATE LibELF LibX86) target_link_libraries(drain PRIVATE LibFileSystem) +target_link_libraries(elfdeps PRIVATE LibELF) target_link_libraries(expr PRIVATE LibRegex) target_link_libraries(fdtdump PRIVATE LibDeviceTree) target_link_libraries(file PRIVATE LibELF LibGfx LibIPC LibArchive LibCompress LibAudio) @@ -110,7 +111,6 @@ target_link_libraries(install-bin PRIVATE LibFileSystem) target_link_libraries(isobmff PRIVATE LibGfx) target_link_libraries(js PRIVATE LibCrypto LibJS LibLine LibLocale LibTextCodec) target_link_libraries(keymap PRIVATE LibKeyboard) -target_link_libraries(ldd PRIVATE LibELF) target_link_libraries(less PRIVATE LibLine) target_link_libraries(ls PRIVATE LibFileSystem LibURL) target_link_libraries(lspci PRIVATE LibPCIDB) diff --git a/Userland/Utilities/ldd.cpp b/Userland/Utilities/elfdeps.cpp similarity index 100% rename from Userland/Utilities/ldd.cpp rename to Userland/Utilities/elfdeps.cpp