Is $ not allowed in names?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Is $ not allowed in names?

edA-qa mort-ora-y
I'm working on my exported symbols, where often I have to join names
together (like module and function name). I'd been doing this with an
underscore '_' and everything worked fine. I decided to switch to '$'
and suddenly the JIT execution is causing segfaults (nothing else changes).

Is the '$' character somehow special and not allowed in identifiers?

I also notice that other symbols, like '[' get encoded at some point
into their ascii hex code it appears. It also causes problems, but at
least it's visible what happened. The '$' is retained and just fails
somehow...

NOTE: I'm able to change to other alpha-numeric sequences and
underscores, like 'A' or "__" and all works fine. So I don't think I'm
getting a name wrong.

--
edA-qa mort-ora-y
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Sign: Please digitally sign your emails.
Encrypt: I'm also happy to receive encrypted mail.
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: Is $ not allowed in names?

Óscar Fuentes
edA-qa mort-ora-y <[hidden email]> writes:

> I'm working on my exported symbols, where often I have to join names
> together (like module and function name). I'd been doing this with an
> underscore '_' and everything worked fine. I decided to switch to '$'
> and suddenly the JIT execution is causing segfaults (nothing else changes).
>
> Is the '$' character somehow special and not allowed in identifiers?

You are using MCJIT, aren't you?

As per

http://llvm.org/docs/LangRef.html#identifiers

`$' is a valid character on LLVM. However, MCJIT adds the naming
restrictions imposed by the object file spec it uses (ELF, IIRC). Which
is something quite nasty to do for a JIT engine, IMO.

[snip]

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: Is $ not allowed in names?

edA-qa mort-ora-y
On 07/11/13 16:20, Óscar Fuentes wrote:
> You are using MCJIT, aren't you?

I'm using the JIT created by "EngineBuilder.setEngineKind(
EngineKind::JIT )". Is that MCJIT?

> `$' is a valid character on LLVM. However, MCJIT adds the naming
> restrictions imposed by the object file spec it uses (ELF, IIRC). Which
> is something quite nasty to do for a JIT engine, IMO.

I thought $ was a safe character on my platform (Linux x86_64), since it
does keep it in the symbol tables. Any idea on where to get a list of
the restrictions for a platform?

--
edA-qa mort-ora-y
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Sign: Please digitally sign your emails.
Encrypt: I'm also happy to receive encrypted mail.
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: Is $ not allowed in names?

Óscar Fuentes
edA-qa mort-ora-y <[hidden email]> writes:

> On 07/11/13 16:20, Óscar Fuentes wrote:
>> You are using MCJIT, aren't you?
>
> I'm using the JIT created by "EngineBuilder.setEngineKind(
> EngineKind::JIT )". Is that MCJIT?

No, unless you also use

    EngineBuilder.setUseMCJIT(true);

>> `$' is a valid character on LLVM. However, MCJIT adds the naming
>> restrictions imposed by the object file spec it uses (ELF, IIRC). Which
>> is something quite nasty to do for a JIT engine, IMO.
>
> I thought $ was a safe character on my platform (Linux x86_64), since it
> does keep it in the symbol tables.

If `$' is admisible for ELF or you are not using MCJIT, there is a bug
either on LLVM or on your code.

> Any idea on where to get a list of the restrictions for a platform?

I guess that googling for "ELF format" will turn useful results.

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev