<div dir="ltr">I've gone ahead and reverted here:<div><br></div><div><div>echristo@athyra ~/s/llvm> git svn dcommit</div><div>Committing to <a href="https://llvm.org/svn/llvm-project/llvm/trunk">https://llvm.org/svn/llvm-project/llvm/trunk</a> ...</div><div><span style="white-space:pre">     </span>D<span style="white-space:pre">    </span>test/MC/ELF/extra-section-flags.s</div><div><span style="white-space:pre">     </span>M<span style="white-space:pre">    </span>lib/MC/MCParser/ELFAsmParser.cpp</div><div>Committed r338968</div></div><div><br></div><div>for now. I'll see if I can spot all of the edge cases when I recommit.</div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Aug 1, 2018 at 7:55 AM Sam Clegg <<a href="mailto:sbc@google.com">sbc@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Ok, cool thanks.<br>
<br>
On Mon, Jul 30, 2018 at 2:49 PM Eric Christopher <<a href="mailto:echristo@gmail.com" target="_blank">echristo@gmail.com</a>> wrote:<br>
><br>
> Hi Sam,<br>
><br>
> IIRC I have a couple of follow on patches in the thread, but I can do that if it's causing you problems for sure. Otherwise I've got a fix I'm planning on landing tomorrow at the latest.<br>
><br>
> -eric<br>
><br>
> On Thu, Jul 26, 2018 at 3:35 AM Sam Clegg <<a href="mailto:sbc@google.com" target="_blank">sbc@google.com</a>> wrote:<br>
>><br>
>> Should we revert this change and reland with the fix when its ready?<br>
>><br>
>> Bug is here: <a href="https://bugs.llvm.org/show_bug.cgi?id=38165" rel="noreferrer" target="_blank">https://bugs.llvm.org/show_bug.cgi?id=38165</a><br>
>> On Tue, Jul 17, 2018 at 2:20 PM Eric Christopher <<a href="mailto:echristo@gmail.com" target="_blank">echristo@gmail.com</a>> wrote:<br>
>> ><br>
>> > Looking. Thanks :)<br>
>> ><br>
>> > On Fri, Jul 13, 2018 at 3:10 PM Sam Clegg <<a href="mailto:sbc@google.com" target="_blank">sbc@google.com</a>> wrote:<br>
>> >><br>
>> >> I believe this change causes previously valid .S files to fail to compile.<br>
>> >><br>
>> >> The error I'm seeing is on the following line:<br>
>> >> .section    .rodata.cst8,"a",@progbits<br>
>> >><br>
>> >> This generates:<br>
>> >> amd64.S:728:44: error: expected the entry size<br>
>> >>         .section .rodata.cst8,"a",@progbits<br>
>> >><br>
>> >> I guess the entry size here was previously implied by the "cst8" name?<br>
>> >><br>
>> >> The file in question is part of ocaml source:<br>
>> >> <a href="https://github.com/ocaml/ocaml/blob/trunk/runtime/amd64.S#L727" rel="noreferrer" target="_blank">https://github.com/ocaml/ocaml/blob/trunk/runtime/amd64.S#L727</a><br>
>> >> On Sun, Jul 1, 2018 at 5:21 PM Eric Christopher via llvm-commits<br>
>> >> <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:<br>
>> >> ><br>
>> >> > Author: echristo<br>
>> >> > Date: Sun Jul  1 17:16:39 2018<br>
>> >> > New Revision: 336072<br>
>> >> ><br>
>> >> > URL: <a href="http://llvm.org/viewvc/llvm-project?rev=336072&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=336072&view=rev</a><br>
>> >> > Log:<br>
>> >> > Add an entry for rodata constant merge sections to the default<br>
>> >> > section flags in the ELF assembler. This matches the defaults<br>
>> >> > given in the rest of MC.<br>
>> >> ><br>
>> >> > Fixes PR37997 where we couldn't assemble our own assembly output<br>
>> >> > without warnings.<br>
>> >> ><br>
>> >> > Modified:<br>
>> >> >     llvm/trunk/lib/MC/MCParser/ELFAsmParser.cpp<br>
>> >> >     llvm/trunk/test/MC/ELF/extra-section-flags.s<br>
>> >> ><br>
>> >> > Modified: llvm/trunk/lib/MC/MCParser/ELFAsmParser.cpp<br>
>> >> > URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCParser/ELFAsmParser.cpp?rev=336072&r1=336071&r2=336072&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCParser/ELFAsmParser.cpp?rev=336072&r1=336071&r2=336072&view=diff</a><br>
>> >> > ==============================================================================<br>
>> >> > --- llvm/trunk/lib/MC/MCParser/ELFAsmParser.cpp (original)<br>
>> >> > +++ llvm/trunk/lib/MC/MCParser/ELFAsmParser.cpp Sun Jul  1 17:16:39 2018<br>
>> >> > @@ -486,6 +486,9 @@ static bool hasPrefix(StringRef SectionN<br>
>> >> >  // defaults.<br>
>> >> >  static unsigned defaultSectionFlags(StringRef SectionName) {<br>
>> >> ><br>
>> >> > +  if (hasPrefix(SectionName, ".rodata.cst"))<br>
>> >> > +    return ELF::SHF_ALLOC | ELF::SHF_MERGE;<br>
>> >> > +<br>
>> >> >    if (hasPrefix(SectionName, ".rodata.") || SectionName == ".rodata1")<br>
>> >> >      return ELF::SHF_ALLOC;<br>
>> >> ><br>
>> >> ><br>
>> >> > Modified: llvm/trunk/test/MC/ELF/extra-section-flags.s<br>
>> >> > URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/extra-section-flags.s?rev=336072&r1=336071&r2=336072&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/extra-section-flags.s?rev=336072&r1=336071&r2=336072&view=diff</a><br>
>> >> > ==============================================================================<br>
>> >> > --- llvm/trunk/test/MC/ELF/extra-section-flags.s (original)<br>
>> >> > +++ llvm/trunk/test/MC/ELF/extra-section-flags.s Sun Jul  1 17:16:39 2018<br>
>> >> > @@ -1,10 +1,12 @@<br>
>> >> >  # RUN: llvm-mc -triple x86_64-unknown-unknown -filetype=obj %s -o /dev/null 2>&1 | FileCheck %s<br>
>> >> > -<br>
>> >> > +<br>
>> >> >  .section .rodata, "ax"<br>
>> >> >  # CHECK: warning: setting incorrect section attributes for .rodata<br>
>> >> >  nop<br>
>> >> ><br>
>> >> >  .section .rodata, "a"<br>
>> >> > -# CHECK-NOT: warning:<br>
>> >> >  nop<br>
>> >> > +.section .rodata.cst4, "aM",@progbits,8<br>
>> >> > +nop<br>
>> >> > +# CHECK-NOT: warning:<br>
>> >> ><br>
>> >> ><br>
>> >> ><br>
>> >> > _______________________________________________<br>
>> >> > llvm-commits mailing list<br>
>> >> > <a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
>> >> > <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div>