[llvm-bugs] [Bug 37644] New: -ffunction-sections

via llvm-bugs llvm-bugs at lists.llvm.org
Thu May 31 15:31:39 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=37644

            Bug ID: 37644
           Summary: -ffunction-sections
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: other
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: ELF
          Assignee: unassignedbugs at nondot.org
          Reporter: mikestump at comcast.net
                CC: llvm-bugs at lists.llvm.org

In the below, clang should not output junk.  gcc does not.

$ cat tgc.c
#include <stdio.h>

int main() {
  return 0;
}

void junk() {
  printf("");
}
$ clang -ffunction-sections -fdata-sections -Wl,--gc-sections  tgc.c; llvm-nm
a.out | grep junk
0000000000000120 T junk
[$ gcc -ffunction-sections -fdata-sections -Wl,--gc-sections  tgc.c; nm a.out |
grep junk
$ 

This is 6.0.1 from the release branch from the monorepo using a custom port. 
Should reproduce I think on any non-darwin port.

-- 
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/20180531/b1841486/attachment.html>


More information about the llvm-bugs mailing list