Index: llvm/trunk/include/llvm/Object/IRSymtab.h =================================================================== --- llvm/trunk/include/llvm/Object/IRSymtab.h +++ llvm/trunk/include/llvm/Object/IRSymtab.h @@ -41,9 +41,9 @@ /// A reference to a string in the string table. struct Str { - Word Offset; + Word Offset, Size; StringRef get(StringRef Strtab) const { - return Strtab.data() + Offset; + return {Strtab.data() + Offset, Size}; } }; Index: llvm/trunk/lib/Object/IRSymtab.cpp =================================================================== --- llvm/trunk/lib/Object/IRSymtab.cpp +++ llvm/trunk/lib/Object/IRSymtab.cpp @@ -28,7 +28,7 @@ Builder(SmallVector &Symtab, SmallVector &Strtab) : Symtab(Symtab), Strtab(Strtab) {} - StringTableBuilder StrtabBuilder{StringTableBuilder::ELF}; + StringTableBuilder StrtabBuilder{StringTableBuilder::RAW}; BumpPtrAllocator Alloc; StringSaver Saver{Alloc}; @@ -49,6 +49,7 @@ void setStr(storage::Str &S, StringRef Value) { S.Offset = StrtabBuilder.add(Value); + S.Size = Value.size(); } template void writeRange(storage::Range &R, const std::vector &Objs) {