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

            Bug ID: 17931
           Summary: --gc-sections doesn't work on section in a group
           Product: binutils
           Version: 2.26 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
          Assignee: unassigned at sourceware dot org
          Reporter: hjl.tools at gmail dot com

[hjl@gnu-6 gc-3]$ cat x.s
        .global _start
_start:
        call bar

    .section    .text.bar,"axG",@progbits,foo,comdat
    .weak    bar
    .type    bar,@function
bar:                                    # @bar
    retq

    .section    .text.zed,"axG",@progbits,foo,comdat
    .weak    zed
    .type    zed,@function
zed:                                    # @zed
    retq
[hjl@gnu-6 gc-3]$ make
gcc -O2 -c x.s
./ld --gc-sections -o x x.o
ld.gold --gc-sections -o y x.o
readelf -sW x | grep FUNC
     2: 000000000040007e     0 FUNC    WEAK   DEFAULT    1 zed
     7: 000000000040007d     0 FUNC    WEAK   DEFAULT    1 bar
readelf -sW y | grep FUNC
     2: 000000000040007d     0 FUNC    WEAK   DEFAULT    1 bar
[hjl@gnu-6 gc-3]$ 

zed should be removed.

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