<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sun, Sep 18, 2016 at 9:23 PM, Davide Italiano <span dir="ltr"><<a href="mailto:dccitaliano@gmail.com" target="_blank">dccitaliano@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">davide added a subscriber: davide.<br>
davide added a comment.<br>
<br>
Side note, I almost always dislike relying on section name specific logic (in the assembler and in the linker), but this is the way things are. LGTM, modulo one comment.</blockquote><div><br></div><div>Yeah, in ELF, names are in spirit just hints for human and don't mean anything semantically. It is unfortunate that we have a lot of exceptions to that rule.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
<br>
================<br>
Comment at: lib/CodeGen/<wbr>TargetLoweringObjectFileImpl.<wbr>cpp:154<br>
</span>@@ -153,1 +153,3 @@<br>
<span class=""> static unsigned getELFSectionType(StringRef Name, SectionKind K) {<br>
+  if (Name.startswith(".note"))<br>
+    return ELF::SHT_NOTE;<br>
</span>----------------<br>
<span class="">phosek wrote:<br>
> ruiu wrote:<br>
> > phosek wrote:<br>
> > > ruiu wrote:<br>
> > > > Shouldn't this be `Name == ".note" || Name.startswith(".note.")`?<br>
> > > That's definitely more strict so it's probably a better solution. The logic in `lib/MC/MCParser/ELFAsmParser.<wbr>cpp` uses `Name.startswith(".note")`, shall I update that as well?<br>
> > I don't know the answer, but I *think* that's the right thing to do.<br>
> I checked the behavior of GNU assembler and it's equivalent to the current implementation, i.e. even `.notefoo` would end up with `SHT_NOTE` type.<br>
</span>Please add a comment here to explain what's going on (maybe add the link to the gcc bug, if you feel it's OK).<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
<a href="https://reviews.llvm.org/D24692" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D24692</a><br>
<br>
<br>
<br>
</div></div></blockquote></div><br></div></div>