<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Jan 10, 2014 at 6:24 PM, David Peixotto <span dir="ltr"><<a href="mailto:dpeixott@codeaurora.org" target="_blank">dpeixott@codeaurora.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">> >> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=196607&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=196607&view=rev</a><br>

> >> Log:<br>
> >> Integrated assembler incorrectly lexes ARM-style comments<br>
> >><br>
> >> The integrated assembler fails to properly lex arm comments when they<br>
> >> are adjacent to an identifier in the input stream. The reason is that<br>
> >> the arm comment symbol '@' is also used as symbol variant in other<br>
> >> assembly languages so when lexing an identifier it allows the '@'<br>
> >> symbol as part of the identifier.<br>
> ><br>
> > This has broken .symver for ELF targets on ARM. Do you plan to fix this?<br>
> > Otherwise I'd ask for a revert.<br>
><br>
> Ugh. Yet another example of why I hate the comment character choice of '@'<br>
> on ARM (no, I don't think we should/can change it; too much history).<br>
><br>
> I agree it's important that symver work as documented. We should:<br>
><br>
> a) fix this bug, it's nasty<br>
> b) write some better test cases for .symver as we obviously have crappy<br>
> ones since they're passing even with this change in the tree.<br>
><br>
> David, do you think you'll have a change to have a look at this soon?<br>
<br>
</div>I've attached a patch that fixes the issue. I added a test for .symver based<br>
on the one for x86. To get the expected output I first undid my change to<br>
allow @ in identifiers and then captured the output. I am not familiar with<br>
what that directive is trying to do, so it would be good if someone could<br>
sanity-check the test.<br></blockquote><div><br></div><div>The symref-arm test seems reasonable to me.  I think that arm-elf-symver.s or arm-elf-symbol-versioning.s would be a more descriptive name, but bike-shedding :-).</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Modifying the Lexer to allow @ in the symbol for that one directive was<br>
relatively easy. The harder part was only doing it for ARM in the<br>
ELFAsmParser. Any feedback to improve the patch is appreciated.<br></blockquote><div><br></div><div>Since this is in the ELF specific parser, and AFAIK, @ is always used for symbol versioning in ELF, is there any reason to perform the check for the target and then behave accordingly?</div>
<div><br></div><div>I think you could simply add in an optional parameter to parseIdentifier (permitAt) to consume an identifier including the at sign only in the symver directive case.  It feels that such a change would be nicer than behaving differently on different targets.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Saleem Abdulrasool<br>compnerd (at) compnerd (dot) org
</div></div>