Is $ not allowed in names?

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 <eda-qa@disemia.com> 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]

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 <eda-qa@disemia.com> writes:

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.