<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Jul 14, 2016 at 3:59 AM, Nat! via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Some of the linker strings are apparently prefixed with \01. I assume this is some sort of escaping mechanism to prevent mangling or demangling.<br></blockquote><div><br></div><div>Correct, \01 is used as an indicator to the backend that the name is not to be touched for decoration purposes.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
```<br>
void CGDebugInfo::EmitFunctionDecl(GlobalDecl GD, SourceLocation Loc,<br>
                                   QualType FnType) {<br>
...<br>
  // the mangled name of the enclosing function.<br>
  if (!name.empty() && name[0] == '\01')<br>
    name = name.substr(1);<br>
```<br>
<br>
<br>
So is it harmless to prefix everything (non C++) with '\01' or are there<br>
reasons not to ? For example in CGObjCMac.cpp everything starting with "l_OBJC_" is prefixed with '\01' where as symbols prefixed with 'OBJC_' are not.<br></blockquote><div><br></div><div>You should not prefix everything with '\01' as that can potentially give you the wrong label name.  Consider the case of user label prefix being non-empty (e.g. Windows m68k).  The result would be that the label would be named incorrectly.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Ciao<br>
   Nat!<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Saleem Abdulrasool<br>compnerd (at) compnerd (dot) org</div>
</div></div>