mstorsjo wrote:

> I'm no real MinGW user, and I couldn't find documentation on the mangling 
> used there, so I relied on examples. The mangled names on i686 mingw32 do 
> have two underscores. From [this comment on an old 
> patch](https://reviews.llvm.org/D22939#500090), it does seem like this is 
> intended. But I can't find where Clang does this. Maybe @mstorsjo knows more?

I'm not entirely sure where that happens in the stack either, but you're right 
- there's a global `_` prefix on all symbols.

> Itanium specifies that mangled names start with _Z (and ___Z for blocks). A 
> second leading underscore is a global symbol prefix added on some platforms 
> (Darwin and possibly mingw?).

Exactly. The extra underscore prefix on i386 isn't mingw specific either, it's 
on MSVC as well - for regular C symbols. For other calling conventions (like 
fastcall or vectorcall) the prefix is different though, and for MSVC C++ 
mangled symbols, there's a different prefix. But Itanium C++ ABI on i386 works 
through the regular (cdecl) mangling, which adds a `_` prefix, just like all 
regular plain C functions.

https://github.com/llvm/llvm-project/pull/160930
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to