[PATCH] [PECOFF] Handle .drectve section.

Saleem Abdulrasool compnerd at compnerd.org
Wed Jul 31 19:28:45 PDT 2013



================
Comment at: lib/ReaderWriter/PECOFF/ReaderCOFF.cpp:415
@@ +414,3 @@
+        return ec;
+      _directives = std::move(std::string(
+          reinterpret_cast<const char *>(&contents[0])));
----------------
Reid Kleckner wrote:
> Is it worth doing any kind of check that the contents are string-like and don't contain null bytes?
Unfortunately, null bytes are valid in the .directve section.  It can be used to separate options to be passed to the linker.  Newlines are also valid terminators of options.  Effectively, the string needs to be stripped, and tokenised to parse the directives.


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



More information about the llvm-commits mailing list