@@ -209,8 +209,7 @@ impl PointerAuthConfig {
209209 const GOT : u32 = 8 ;
210210 const GOTOS : u32 = 9 ;
211211 const TYPEINFO_VT_PTR_DISCR : u32 = 10 ;
212- // FIXME(jchlanda) We don't yet support function pointer type discrimination.
213- // const FPTR_TYPE_DISCR: u32 = 11;
212+ const FPTR_TYPE_DISCR : u32 = 11 ;
214213
215214 let pauth_abi_version: u32 = ( u32:: from ( self . intrinsics ) << INTRINSICS )
216215 | ( u32:: from ( self . function_pointers . is_some ( ) ) << CALLS )
@@ -228,7 +227,10 @@ impl PointerAuthConfig {
228227 } ) ) << INIT_FINI_ADDR_DISC )
229228 | ( u32:: from ( self . elf_got ) << GOT )
230229 | ( u32:: from ( self . indirect_gotos ) << GOTOS )
231- | ( u32:: from ( self . typeinfo_vt_ptr_discrimination ) << TYPEINFO_VT_PTR_DISCR ) ;
230+ | ( u32:: from ( self . typeinfo_vt_ptr_discrimination ) << TYPEINFO_VT_PTR_DISCR )
231+ | ( u32:: from ( self . function_pointers . as_ref ( ) . is_some_and ( |schema| {
232+ matches ! ( schema. discrimination_kind, PointerAuthDiscrimination :: Type )
233+ } ) ) << FPTR_TYPE_DISCR ) ;
232234
233235 pauth_abi_version
234236 }
@@ -1446,19 +1448,6 @@ fn validate_commandline_args_with_session_available(sess: &Session) {
14461448 sess. dcx ( ) . emit_err ( diagnostics:: LinkerPluginToWindowsNotSupported ) ;
14471449 }
14481450
1449- if sess
1450- . pointer_auth_config
1451- . as_ref ( )
1452- . and_then ( |cfg| cfg. function_pointers . as_ref ( ) )
1453- . is_some_and ( |schema| matches ! ( schema. discrimination_kind, PointerAuthDiscrimination :: Type ) )
1454- {
1455- sess. dcx ( ) . emit_err (
1456- diagnostics:: PointerAuthenticationTypeDiscriminationNotSupportedForTarget {
1457- target_triple : & sess. opts . target_triple ,
1458- } ,
1459- ) ;
1460- }
1461-
14621451 if sess. target . cfg_abi != CfgAbi :: Pauthtest
14631452 && !sess. opts . unstable_opts . pointer_authentication . is_empty ( )
14641453 {
0 commit comments