[PATCH] D6379: Only warn about DWARF2 supporting one section per compilation unit for code sections

Paul Robinson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 25 14:25:36 PDT 2017


probinson added a comment.

In https://reviews.llvm.org/D6379#852974, @dim wrote:

> Actually I see that we also get this warning on our `.section ".note.GNU-stack","", at progbits` directives, which are in most of our hand-written .S files. Since the type of that section is progbits, this fix won't work for it.
>
> However, interestingly, clang also outputs these same `.note.GNU-stack` directives in .s output for compiled files, but it does *not* warn on those, even when using `-gdwarf-2`.  So how is it avoiding them in that case?


Because when clang compiles a C/C++ source, it generates all the necessary debug-info directives and then runs the assembler phase without `-g`.  The path you are modifying is for running the assembler phase with `-g`.
If you do `clang -S foo.c` and `clang -gdwarf-2 foo.s` you should see the warning.


https://reviews.llvm.org/D6379





More information about the llvm-commits mailing list