[PATCH] D53796: [libcxx] Use AS_NEEDED command for linker script inputs
Petr Hosek via Phabricator
reviews at reviews.llvm.org
Sat Oct 27 17:08:02 PDT 2018
phosek created this revision.
phosek added reviewers: EricWF, ldionne, mclow.lists.
Herald added subscribers: libcxx-commits, christof.
This ensures that ELF shared libraries are only added when they are
actually needed, so when using C++ driver for linking, ELF outputs
that don't use any C++ standard library symbols won't end up with
unnecessary DT_NEEDED entries in the dynamic section.
Repository:
rCXX libc++
https://reviews.llvm.org/D53796
Files:
libcxx/utils/gen_link_script.py
Index: libcxx/utils/gen_link_script.py
===================================================================
--- libcxx/utils/gen_link_script.py
+++ libcxx/utils/gen_link_script.py
@@ -70,7 +70,7 @@
# Generate the linker script contents and print the script and destination
# information.
- contents = "INPUT(%s %s)" % (linked_libcxx, ' '.join(public_libs))
+ contents = "INPUT(AS_NEEDED(%s %s))" % (linked_libcxx, ' '.join(public_libs))
print("GENERATING SCRIPT: '%s' as file %s" % (contents, symlink_file))
# Remove the existing libc++ symlink and replace it with the script.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53796.171414.patch
Type: text/x-patch
Size: 606 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20181028/f0cf06ef/attachment.bin>
More information about the libcxx-commits
mailing list