Page MenuHomePhabricator

[MC] Add support for generating missing GNU build notes
Needs ReviewPublic

Authored by tbaeder on Jul 29 2020, 7:09 AM.

Details

Summary

Add support for generating missing GNU build notes to the LLVM assembler.

This makes clang accept and pass through -Wa,--generate-missing-build-notes=[yes/no]. If =yes is passed (the default is no), then the assembler will check whether a .gnu.build.attributes section is present. If not, it will generate one for all relevant code sections.

This is the equivalent to what the GNU assembler gas is already doing in maybe_generate_build_notes() in gas/write.c: https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=gas/write.c;h=0b43063bbaab76d21fe3bac5fb4643bfff3c72e2;hb=HEAD#l1954

Diff Detail

Event Timeline

tbaeder created this revision.Jul 29 2020, 7:09 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald Transcript
tbaeder requested review of this revision.Jul 29 2020, 7:09 AM
tbaeder updated this revision to Diff 284308.Aug 10 2020, 3:48 AM

Add a test that checks that clang accepts -Wa,--generate-missing-build-notes=yes and -Wa,--generate-missing-build-notes=no

https://fedoraproject.org/wiki/Toolchain/Watermark Seems that .gnu.build.attributes is used with a GCC plugin (annobin?). The feature on its own is probably not that useful. .gnu.linkonce is a proto-comdat legacy feature which the patch should ignore.

https://fedoraproject.org/wiki/Toolchain/Watermark Seems that .gnu.build.attributes is used with a GCC plugin (annobin?). The feature on its own is probably not that useful. .gnu.linkonce is a proto-comdat legacy feature which the patch should ignore.

I can update the patch to ignore .gnu.linkonce. As for annobin, it can also be used as a clang plugin these days.

tbaeder updated this revision to Diff 316944.Fri, Jan 15, 7:18 AM
tbaeder updated this revision to Diff 316945.Fri, Jan 15, 7:19 AM

Sorry about the last change, that was the wrong patch.

martong removed a subscriber: martong.Tue, Jan 19, 6:47 AM