[cfe-commits] [PATCH] ASan: support for zero-based shadow for PIE binaries (Clang part).

Richard Smith richard at metafoo.co.uk
Wed Jan 16 12:59:43 PST 2013


  The option name seems reasonable to me.


================
Comment at: include/clang/Driver/Options.td:398-400
@@ -395,1 +397,5 @@
+                                   HelpText<"Assume that code is built with PIE in AddressSanitizer">;
+def fno_sanitize_address_assume_pie : Flag<["-"], "fno-sanitize-address-assume-pie">,
+                                      Group<f_clang_Group>,
+                                      HelpText<"Don't assume that code is built with PIE in AddressSanitizer">;
 def fsanitize_blacklist : Joined<["-"], "fsanitize-blacklist=">,
----------------
We generally only provide documentation for the non-default value of a flag, to keep the --help output shorter.

================
Comment at: lib/Driver/Tools.cpp:1527
@@ -1518,1 +1526,3 @@
     if (!Args.hasArg(options::OPT_shared)) {
+      bool assume_pie = Args.hasFlag(
+          options::OPT_fsanitize_address_assume_pie,
----------------
AssumePie

================
Comment at: lib/Driver/Tools.cpp:1530-1532
@@ +1529,5 @@
+          options::OPT_fno_sanitize_address_assume_pie, false);
+      if (assume_pie && !Args.hasArg(options::OPT_pie)) {
+        TC.getDriver().Diag(diag::err_drv_argument_only_allowed_with) <<
+            "-fsanitize-address-assume-pie" << "-pie";
+      }
----------------
Can we also issue a diagnostic in the compilation step if -fsanitize-address-assume-pie is given and we don't have -fPIC/-fPIE/-fpic/-fpie?


http://llvm-reviews.chandlerc.com/D303



More information about the cfe-commits mailing list