llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.37k stars 11.71k forks source link

--print-gc-sections: print group signatures #46127

Open MaskRay opened 4 years ago

MaskRay commented 4 years ago
Bugzilla Link 46783
Version unspecified
OS Linux
CC @petrhosek,@smithp35

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'

MaskRay commented 4 years ago

Another problem I find is that when we are constructing nextInSectionGroup, we do not check whether it can form a loop.