================
@@ -2513,6 +2513,12 @@ def CountedByOrNull : DeclOrTypeAttr {
   let LangOpts = [COnly];
 }
 
+def NoPointerFieldProtection : DeclOrTypeAttr {
----------------
pcc wrote:

There are numerous circumstances where the C++ ABI is distinct from the 
platform ABI and is allowed to change. For example, most Chromium-based web 
browsers ship with a statically linked libc++, and the same is true for many 
Android apps and server-side software at Google. In the intended usage model, 
all of libc++ would be built with a `-fexperimental-pointer-field-protection=` 
flag consistent with the rest of the program.

The libc++abi opt-outs that I added are only for opting out pointer fields of 
RTTI structs that are generated by the compiler. In principle, we could teach 
the compiler to sign those pointer fields which would let us remove the 
opt-outs, but there is a lower ROI for subjecting those fields to PFP because 
the RTTI structs are not typically dynamically allocated.

We may consider adding an attribute to allow opting in in the case where the 
flag is not passed. But I think we should do that in a followup. We would need 
to carefully consider how that would interact with the other aspects of the 
opt-in solution, such as the pointer qualifiers.

https://github.com/llvm/llvm-project/pull/133538
_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to