-
Notifications
You must be signed in to change notification settings - Fork 14.6k
[PAC] Add support for __ptrauth type qualifier #100830
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 14 commits
51c21ae
d0021ea
66c1f79
73a2422
f098322
a760923
d64227d
a8c8554
ad7f94e
0868bf3
c343b0e
8f2fa5a
fe01536
b6adace
c965ad0
ae8a37e
c95c9dd
636e815
02299cb
24f33cd
9cbf8b0
45e5b93
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2850,6 +2850,26 @@ void CXXNameMangler::mangleQualifiers(Qualifiers Quals, const DependentAddressSp | |
if (Quals.hasUnaligned()) | ||
mangleVendorQualifier("__unaligned"); | ||
|
||
// __ptrauth. Note that this is parameterized. | ||
if (PointerAuthQualifier PtrAuth = Quals.getPointerAuth()) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We seem to be missing mangling for Microsoft; should we be using a vendor mangling there? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @AaronBallman we'd need MS to decide what their mangling would be - if it is to be different from this, or if MS ever want to support ptrauth? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oops, I missed the question that was here, but this does still need to be addressed. We don't need MS to be involved, we can pick our own mangling and try to avoid potential conflicts by making it ugly (we do this for plenty of other extensions). But we're missing test coverage because we have no C++ tests for mangling or demangling (Microsoft or Itanium). I think we're missing the demangling implementation entirely, but we lately have been trying to get folks to do them at the same time so the demangler stays closer in sync with the mangler. (Test coverage would be: CodeGen tests with an Itanium and a Microsoft ABI making sure we emit the expected manglings in C++ with a FileCheck test + There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Demangling already works for Itanium, though the qualifier might appear a little odd (it resembles a template instantiation). For example:
|
||
mangleVendorQualifier("__ptrauth"); | ||
// For now, since we only allow non-dependent arguments, we can just | ||
// inline the mangling of those arguments as literals. We treat the | ||
// key and extra-discriminator arguments as 'unsigned int' and the | ||
// address-discriminated argument as 'bool'. | ||
Out << "I" | ||
AaronBallman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"Lj" | ||
<< PtrAuth.getKey() | ||
<< "E" | ||
"Lb" | ||
<< unsigned(PtrAuth.isAddressDiscriminated()) | ||
<< "E" | ||
"Lj" | ||
<< PtrAuth.getExtraDiscriminator() | ||
<< "E" | ||
"E"; | ||
} | ||
|
||
// Remaining ARC ownership qualifiers. | ||
switch (Quals.getObjCLifetime()) { | ||
case Qualifiers::OCL_None: | ||
|
Uh oh!
There was an error while loading. Please reload this page.