summaryrefslogtreecommitdiffstats
path: root/clang/docs/MemorySanitizer.rst
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2013-04-09 04:35:11 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2013-04-09 04:35:11 +0000
commit54d770cb1fedf23466eb75e7f34fa561e8d63d23 (patch)
treea1e95e1c4200129e7d038a54da1ab6e80da42f41 /clang/docs/MemorySanitizer.rst
parent61e221f68de5b7b32cea552e3b4ef7838eb2182c (diff)
downloadbcm5719-llvm-54d770cb1fedf23466eb75e7f34fa561e8d63d23.tar.gz
bcm5719-llvm-54d770cb1fedf23466eb75e7f34fa561e8d63d23.zip
If the user requested a zero-base-shadow sanitizer, infer -pie and -fPIC when appropriate.
Differential Revision: http://llvm-reviews.chandlerc.com/D502 llvm-svn: 179082
Diffstat (limited to 'clang/docs/MemorySanitizer.rst')
-rw-r--r--clang/docs/MemorySanitizer.rst9
1 files changed, 6 insertions, 3 deletions
diff --git a/clang/docs/MemorySanitizer.rst b/clang/docs/MemorySanitizer.rst
index fdb8a810232..439acc47fa2 100644
--- a/clang/docs/MemorySanitizer.rst
+++ b/clang/docs/MemorySanitizer.rst
@@ -46,7 +46,7 @@ to disable inlining (just use ``-O1``) and tail call elimination
return 0;
}
- % clang -fsanitize=memory -fPIE -pie -fno-omit-frame-pointer -g -O2 umr.cc
+ % clang -fsanitize=memory -fno-omit-frame-pointer -g -O2 umr.cc
If a bug is detected, the program will print an error message to
stderr and exit with a non-zero exit code. Currently, MemorySanitizer
@@ -103,7 +103,7 @@ the example above,
.. code-block:: console
- % clang -fsanitize=memory -fsanitize-memory-track-origins -fPIE -pie -fno-omit-frame-pointer -g -O2 umr.cc
+ % clang -fsanitize=memory -fsanitize-memory-track-origins -fno-omit-frame-pointer -g -O2 umr.cc
% ./a.out 2>log
% projects/compiler-rt/lib/asan/scripts/asan_symbolize.py / < log | c++filt
==14425== WARNING: MemorySanitizer: UMR (uninitialized-memory-read)
@@ -160,7 +160,10 @@ Limitations
address space. This means that tools like ``ulimit`` may not work as
usually expected.
* Static linking is not supported.
-* Non-position-independent executables are not supported.
+* Non-position-independent executables are not supported. Therefore, the
+ ``fsanitize=memory`` flag will cause Clang to act as though the ``-fPIE``
+ flag had been supplied if compiling without ``-fPIC``, and as though the
+ ``-pie`` flag had been supplied if linking an executable.
* Depending on the version of Linux kernel, running without ASLR may
be not supported. Note that GDB disables ASLR by default. To debug
instrumented programs, use "set disable-randomization off".
OpenPOWER on IntegriCloud