Fix -Wcast-qual warnings.
authorRui Ueyama <ruiu@google.com>
Fri, 4 Nov 2016 17:41:29 +0000 (17:41 +0000)
committerRui Ueyama <ruiu@google.com>
Fri, 4 Nov 2016 17:41:29 +0000 (17:41 +0000)
llvm-svn: 286001

lld/COFF/PDB.cpp
lld/ELF/SyntheticSections.cpp

index 283b75a..92b32ea 100644 (file)
@@ -66,7 +66,7 @@ void coff::createPDB(StringRef Path, ArrayRef<uint8_t> SectionTable) {
 
   // Add Section Map stream.
   ArrayRef<object::coff_section> Sections = {
-      (object::coff_section *)SectionTable.data(),
+      (const object::coff_section *)SectionTable.data(),
       SectionTable.size() / sizeof(object::coff_section)};
   std::vector<pdb::SecMapEntry> SectionMap =
       pdb::DbiStreamBuilder::createSectionMap(Sections);
index 6275170..0df51b3 100644 (file)
@@ -40,7 +40,7 @@ using namespace lld::elf;
 static ArrayRef<uint8_t> createInterp() {
   // StringSaver guarantees that the returned string ends with '\0'.
   StringRef S = Saver.save(Config->DynamicLinker);
-  return {(uint8_t *)S.data(), S.size() + 1};
+  return {(const uint8_t *)S.data(), S.size() + 1};
 }
 
 template <class ELFT>