[llvm-bugs] [Bug 43681] New: dead_strip_dylibs does not eliminate dylibs referenced by code removed with dead_strip
via llvm-bugs
llvm-bugs at lists.llvm.org
Tue Oct 15 08:43:14 PDT 2019
https://bugs.llvm.org/show_bug.cgi?id=43681
Bug ID: 43681
Summary: dead_strip_dylibs does not eliminate dylibs referenced
by code removed with dead_strip
Product: lld
Version: unspecified
Hardware: Macintosh
OS: MacOS X
Status: NEW
Severity: normal
Priority: P
Component: MachO
Assignee: unassignedbugs at nondot.org
Reporter: szinukhov at parallels.com
CC: llvm-bugs at lists.llvm.org
dead_strip_dylib does not produce expected effect when combined with
dead_strip, as dynamic libraries referenced by eliminated code are not removed.
Only dynamic libraries removed by dead_strip_dylibs are those which are not
referenced at all.
Example
#include <cups/cups.h>
void unused() {
cupsGetDefault();
}
int main(int argc, const char * argv[]) {
return 0;
}
Invoking
clang -o binary main.c -lcups -framework CoreFoundation -Wl,-dead_strip
-Wl,-dead_strip_dylibs
Will produce binary without code referencing cups but still with LC_LOAD_DYLIB
libcups.2.dylib in.
(Note that CoreFoundation reference was correctly stripped - no code is using
it)
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20191015/cfa6172d/attachment.html>
More information about the llvm-bugs
mailing list