Rather than rendering an argument to a std::string (which is primarily intended for debugging and diagnostic output), just inspect the spelling to check for specific prefixes in drectve section flags.
Rather than rendering an argument to a std::string (which is primarily
intended for debugging and diagnostic output), just inspect the spelling
to check for specific prefixes in drectve section flags.

In addition to being significantly cheaper and not relying on
a debugging interface, this also avoids creating a temporary string and
binding it to StringRef variable. We then went on to access it after the
memory had been deallocated.

This bug too was caught by ASan. I love ASan so much. =]

git-svn-id: f6089bf0e6284f307027cef4f64114ee9ebb0424@193487 91177308-0d34-0410-b5e6-96231b3b80d8

llvm-mirror/lld,llvm-mirror/lld