This is an archive of the discontinued LLVM Phabricator instance.

[MC] Add support for generating missing GNU build notes
AbandonedPublic

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.Jan 15 2021, 7:18 AM
tbaeder updated this revision to Diff 316945.Jan 15 2021, 7:19 AM

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

martong removed a subscriber: martong.Jan 19 2021, 6:47 AM
tbaeder abandoned this revision.Feb 21 2022, 10:57 PM