-
Notifications
You must be signed in to change notification settings - Fork 0
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
[PAuth] Emit Dwarf info for implicitly signed pointers #63
Comments
A question arises here if explicitly and implicitly signed pointers with identical effective signing schemas should have the same Dwarf info. As for now, I suppose that we can use the same info for simplicity, but if it's expected that such types should be treated different, the Dwarf info should be different as well. |
With #64 applied, we have
For virtual function pointers, things are a bit different. We do not have the virtual table as a thing in IR debug metadata nodes and in Dwarf info. Instead, we only have an artificial member of a polymorphic class which holds the pointer to the table, and an attribute for virtual functions holding their position in the table. So, there is no object with A possible solution is to propose a new attribute for For both signed virtual table pointers and signed virtual function pointers in the table, we should teach the debugger to look at the corresponding attributes and apply the requested signing schema when constructing user expressions. For free and member function pointers, this should be transparent since we just changed the type and a |
Tagging @ahmedbougacha |
Closing with the same reason as related #64 (should have been closed together with that): #64 (comment) |
In f28e8db,
DW_TAG_LLVM_ptrauth_type
and corresponding attributes were introduced. However, those are only emitted for explicitly signed pointers (those with explicit__ptrauth
specifier).Consider the following code:
When building for a Linux target with
-mbranch-protection=pauthabi
(or for an Apple's arm64e), we get the following Dwarf info (unrelated parts omitted):So, only pointer
b
is listed in Dwarf info as signed, whiley
is not. However, for bothb
andy
signedR_AARCH64_AUTH_ABS64
relocations are emitted, so they are actually both signed (as expected when using-mbranch-protection=pauthabi
).The same issue also applies to other implicitly signed pointers (by implicitly we here mean without explicit
__ptrauth
specifier): pointers to member functions, vtable pointers, function pointers with are signed at runtime instead of a relocation.The fix should include changes in functions declared in
llvm/include/llvm/IR/DIBuilder.h
, such asDIBuilder::createClassType
. Now, we haveDIBuilder::createPtrAuthQualifiedType
which is only applied to pointers with__ptrauth
specifier.The text was updated successfully, but these errors were encountered: