https://sourceware.org/bugzilla/show_bug.cgi?id=20717

            Bug ID: 20717
           Summary: --gc-sections fails to remove an unused orphan section
                    if the last output section has a KEEP command.
           Product: binutils
           Version: 2.28 (HEAD)
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gold
          Assignee: ccoutant at gmail dot com
          Reporter: ikudrin.dev at gmail dot com
                CC: ian at airs dot com
  Target Milestone: ---

Steps to reproduce:

$ cat > test.cc << EOF
void unused() {}
int main() {return 0;}
EOF

$ cat > test.t << EOF
SECTIONS
{
    .dummy : { KEEP (*(.dummy)) }
}
EOF

$ gcc -O0 -ffunction-sections -c test.cc -o test.o
$ gcc -fuse-ld=gold -Wl,--gc-sections,-T,test.t test.o -o test
$ nm -C test | grep unused
00000000000001e9 T unused()

-- 
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

Reply via email to