3 ms·
The leading '_' before symbols isn't just a macOS thing, AFAIK this is the only "name mangling" that C does and from what I've seen so far it's the same across
by flohofwoe 6y ago
The leading '_' before symbols isn't just a macOS thing, AFAIK this is the only "name mangling" that C does and from what I've seen so far it's the same across platforms and compilers.
As far as the ABI goes: the important thing is that there is a standard ABI on a specific platform that all compilers on that platform agree on. Sounds kinda obvious, but it's not common in other languages.
- jcelerier 6y ago> The leading '_' before symbols isn't just a macOS thing it definitely is - see e.g. https://github.com/llvm-mirror/lld/blob/master/lib/ReaderWriter/MachO/MachOLinkingContext.cpp#L874 https://github.com/llvm-mirror/lld/blob/master/lib/ReaderWri...
- flohofwoe 6y agoOh ok, that must be an extra leading underscore then, haven't stumbled over this yet though.
- jcelerier 6y agothe only cases you stumble over it is if you're trying to do linking / symbol loading yourself manually (e.g. in my case it was because I was looking into JIT compilation mechanisms)