bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gold/20717] New: --gc-sections fails to remove an unused orphan sec


From: ikudrin.dev at gmail dot com
Subject: [Bug gold/20717] New: --gc-sections fails to remove an unused orphan section if the last output section has a KEEP command.
Date: Wed, 19 Oct 2016 13:01:31 +0000

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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]