[llvm] r192775 - Revert r192758 (and r192759), "MC: Better handling of tricky symbol and section names"

Hans Wennborg hans at chromium.org
Fri Oct 18 08:15:06 PDT 2013


On Fri, Oct 18, 2013 at 7:19 AM, Rafael EspĂ­ndola
<rafael.espindola at gmail.com> wrote:
> On 18 October 2013 05:39, David Majnemer <david.majnemer at gmail.com> wrote:
>> My mingw doesn't quote the call operand, mov operand, the label or the .def
>> directive...
>
> I wonder gas just handles foo at numbers differently from bar at letters.

I think gas simply treats @ as a normal character in identifiers on
COFF. That means it won't get foo at IMGREL right for example.

There are two problems with our asm parser:

1. It doesn't allow @ as the first character of identifiers. I'm
hoping to just allow this in parseIdentifier()
2. When parsing expressions, it treats the part after @ in identifiers
as a symbol variant (e.g. GOT, PLT, etc.), and if it doesn't match a
known variant, we error out.

I'm thinking maybe we can fix 2 by not erroring out if it doesn't
match a known variant, but treat it as a full symbol name instead, at
least on COFF.

There would still be some ambiguities, i.e. if we really have a symbol
named foo at IMGREL we have a problem, but it would be strictly better
than the current situation where we basically can't parse asm on win32
at all.

I'll try to get a patch out for that and would be grateful for any thoughts.

Cheers,
Hans




More information about the llvm-commits mailing list