<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Sun, Apr 16, 2017 at 6:29 AM Dimitry Andric via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">dim added a comment.<br>
<br>
In <a href="https://reviews.llvm.org/D6379#95991" rel="noreferrer" target="_blank">https://reviews.llvm.org/D6379#95991</a>, @dblaikie wrote:<br>
<br>
> Should we add that filter elsewhere rather than here? (eg: we shouldn't be adding such non-text sections into the Sections map if they're not part of teh DWARF anyway, right?)<br>
<br>
<br>
I realized this review was still in the system from a long time ago, and the situation still hasn't changed: this warning still pops up regularly.  David, I'm trying to interpret your comment here, how would we prevent inserting such sections?<br></blockquote><div><br>What I meant was - do we need these sections in this Sections map if they aren't progbits? Looking at the code I guess we do need them there for other things? Presumably those "other things" also include needing the labels that're being created there for other things too?<br><br>So maybe this is the best spot for this handling.<br><br>That said: I don't really understand how this correctly diagnoses only the case of more than one section & why this coed doesn't run for the first section... <br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Note that in FreeBSD, we commonly see this warning due to `.note.GNU-stack` sections being artificially inserted at the end of .S files, for example here: <a href="https://github.com/freebsd/freebsd/blob/master/libexec/rtld-elf/amd64/rtld_start.S#L171" rel="noreferrer" target="_blank">https://github.com/freebsd/freebsd/blob/master/libexec/rtld-elf/amd64/rtld_start.S#L171</a> .  Since the file starts with a `.text` section, which has progbits type, the last line with `.section .note.GNU-stack,"",%progbits` triggers this warning, which may even be right.  Not sure how you should insert such a section otherwise.<br>
<br>
> & this could use a test case as well.<br>
<br>
IIRC I had one at some point, maybe I can come up with a new one, otherwise I will just abandon this review.<br>
<br>
<br>
<a href="https://reviews.llvm.org/D6379" rel="noreferrer" target="_blank">https://reviews.llvm.org/D6379</a><br>
<br>
<br>
<br>
</blockquote></div></div>