https://sourceware.org/bugzilla/show_bug.cgi?id=24836
Bug ID: 24836 Summary: --as-needed leaves unused direct dependencies Product: binutils Version: 2.30 Status: UNCONFIRMED Severity: normal Priority: P2 Component: ld Assignee: unassigned at sourceware dot org Reporter: crusader.mike at gmail dot com Target Milestone: --- I have a binary that is linked like this: /opt/rh/devtoolset-8/root/usr/bin/g++ -O3 -DNDEBUG -Wl,--gc-sections -s -Wl,--as-needed <few .o files> -o procmon.e -Wl,-rpath,/usr/local/lib64 <bunch of my static libs .a> /usr/local/lib64/libxalan-c.so /usr/local/lib64/libxerces-c.so <bunch of static libs(1) built with "vcpkg" intermixed with (2)> (1) curl z aws-cpp-sdk-s3 aws-cpp-sdk-core ssl crypto aws-c-event-stream aws-c-common aws-checksums azurestorage uuid xml2 zma cpprest boost_log boost_log_setup boost_filesystem boost_thread boost_date_time boost_regex boost_chrono boost_atomic (2) -lcrypt -lrt -lm -ldl -pthread but (even though --as-needed is present) ldd still reports unused dependencies: $ ldd -u -r procmon.e Unused direct dependencies: /usr/local/lib64/libxalan-c.so.111 /lib64/libcrypt.so.1 /lib64/libm.so.6 Info: CentOS 7 g++ (GCC) 8.2.1 20180905 (Red Hat 8.2.1-3) GNU ld version 2.30-47.el7 -- You are receiving this mail because: You are on the CC list for the bug. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils