Open MaskRay opened 4 years ago
Petr Hosek reported that GNU ld has a nicer information. For example:
% cat a.s .section .text.foo,"aG",@progbits,foo,comdat .byte 0 .section __sancov_cntrs,"aG",@progbits,foo,comdat .byte 0
% ld.lld --gc-sections --print-gc-sections -e 0 a.o -o a removing unused section a.o:(.text) removing unused section a.o:(.text.foo) removing unused section a.o:(__sancov_cntrs)
% ld.bfd --gc-sections --print-gc-sections -e 0 a.o -o a ld.bfd: removing unused section '.group' in file 'a.o' ld.bfd: removing unused section '.text.foo[foo]' in file 'a.o' ld.bfd: removing unused section '__sancov_cntrs[foo]' in file 'a.o'
Another problem I find is that when we are constructing nextInSectionGroup, we do not check whether it can form a loop.
Extended Description
Petr Hosek reported that GNU ld has a nicer information. For example:
% cat a.s .section .text.foo,"aG",@progbits,foo,comdat .byte 0 .section __sancov_cntrs,"aG",@progbits,foo,comdat .byte 0
% ld.lld --gc-sections --print-gc-sections -e 0 a.o -o a removing unused section a.o:(.text) removing unused section a.o:(.text.foo) removing unused section a.o:(__sancov_cntrs)
Ggroup signature in the output.
% ld.bfd --gc-sections --print-gc-sections -e 0 a.o -o a ld.bfd: removing unused section '.group' in file 'a.o' ld.bfd: removing unused section '.text.foo[foo]' in file 'a.o' ld.bfd: removing unused section '__sancov_cntrs[foo]' in file 'a.o'