rs6000: Conditionally define __ROP_PROTECT__
authorBill Schmidt <wschmidt@linux.ibm.com>
Thu, 13 May 2021 18:10:10 +0000 (13:10 -0500)
committerBill Schmidt <wschmidt@linux.ibm.com>
Sat, 15 May 2021 19:05:05 +0000 (14:05 -0500)
2021-05-13  Bill Schmidt  <wschmidt@linux.ibm.com>

gcc/
* config/rs6000/rs6000-c.c (rs6000_target_modify_macros): Define
__ROP_PROTECT__ if -mrop-protect is selected.

gcc/config/rs6000/rs6000-c.c

index 0f8a629..afcb5bb 100644 (file)
@@ -602,6 +602,9 @@ rs6000_target_modify_macros (bool define_p, HOST_WIDE_INT flags,
   /* Whether pc-relative code is being generated.  */
   if ((flags & OPTION_MASK_PCREL) != 0)
     rs6000_define_or_undefine_macro (define_p, "__PCREL__");
+  /* Tell the user -mrop-protect is in play.  */
+  if (rs6000_rop_protect)
+    rs6000_define_or_undefine_macro (define_p, "__ROP_PROTECT__");
 }
 
 void